Skip to content

Commit

Permalink
Fix: Response.clicked only true if the widget senses clicks
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Jan 25, 2024
1 parent f507f1a commit 5ed021e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/egui/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ impl Context {
res.drag_released = res.dragged;
res.dragged = false;

if res.hovered && res.is_pointer_button_down_on {
if sense.click && res.hovered && res.is_pointer_button_down_on {
if let Some(click) = click {
let clicked = res.hovered && res.is_pointer_button_down_on;
res.clicked[*button as usize] = clicked;
Expand All @@ -1070,6 +1070,7 @@ impl Context {
clicked && click.is_triple();
}
}

res.is_pointer_button_down_on = false;
}
}
Expand Down

0 comments on commit 5ed021e

Please sign in to comment.