Skip to content

Commit

Permalink
Don't treat PointerGone as Released
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed May 21, 2024
1 parent 37d76e2 commit 8c72df9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions crates/egui/src/input_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -800,10 +800,8 @@ impl PointerState {
}
Event::PointerGone => {
self.latest_pos = None;
self.pointer_events.push(PointerEvent::Released {
click: None,
button: PointerButton::Primary,
});
// When dragging a slider and the mouse leaves the viewport, we still want the drag to work,
// so we don't treat this as a `PointerEvent::Released`.
// NOTE: we do NOT clear `self.interact_pos` here. It will be cleared next frame.
}
Event::MouseMoved(delta) => *self.motion.get_or_insert(Vec2::ZERO) += *delta,
Expand Down

0 comments on commit 8c72df9

Please sign in to comment.