Skip to content

Commit

Permalink
Give each tooltip area its own unique Id (#2264)
Browse files Browse the repository at this point in the history
* Don't check for clicks on non-interactive areas

* Give each tooltip area its own unique Id
  • Loading branch information
emilk committed Nov 8, 2022
1 parent 3521360 commit 51ff327
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion crates/egui/src/containers/area.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,10 @@ impl Area {
let interact_id = layer_id.id.with("move");
let sense = if movable {
Sense::click_and_drag()
} else {
} else if interactable {
Sense::click() // allow clicks to bring to front
} else {
Sense::hover()
};

let move_response = ctx.interact(
Expand Down
3 changes: 2 additions & 1 deletion crates/egui/src/containers/popup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ fn show_tooltip_at_avoid_dyn<'c, R>(

let position = position.at_least(ctx.input().screen_rect().min);

let InnerResponse { inner, response } = show_tooltip_area_dyn(ctx, id, position, add_contents);
let InnerResponse { inner, response } =
show_tooltip_area_dyn(ctx, id.with(count), position, add_contents);

state.set_tooltip_size(id, count, response.rect.size());
state.store(ctx);
Expand Down

0 comments on commit 51ff327

Please sign in to comment.