Treat `Event::PointerGone` as `PointerEvent::Released` (#4419)
* Closes #4406 * Closes #4418 If `Event::PointerGone` occurs, it is treated as `PointerEvent::Released`.
This commit is contained in:
parent
11fa9cc7ee
commit
66d2b3ffe4
|
|
@ -1875,8 +1875,8 @@ impl Context {
|
||||||
drag_started: _,
|
drag_started: _,
|
||||||
dragged,
|
dragged,
|
||||||
drag_stopped: _,
|
drag_stopped: _,
|
||||||
contains_pointer,
|
|
||||||
hovered,
|
hovered,
|
||||||
|
contains_pointer,
|
||||||
} = interact_widgets;
|
} = interact_widgets;
|
||||||
|
|
||||||
if true {
|
if true {
|
||||||
|
|
|
||||||
|
|
@ -800,6 +800,10 @@ impl PointerState {
|
||||||
}
|
}
|
||||||
Event::PointerGone => {
|
Event::PointerGone => {
|
||||||
self.latest_pos = None;
|
self.latest_pos = None;
|
||||||
|
self.pointer_events.push(PointerEvent::Released {
|
||||||
|
click: None,
|
||||||
|
button: PointerButton::Primary,
|
||||||
|
});
|
||||||
// NOTE: we do NOT clear `self.interact_pos` here. It will be cleared next frame.
|
// 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,
|
Event::MouseMoved(delta) => *self.motion.get_or_insert(Vec2::ZERO) += *delta,
|
||||||
|
|
|
||||||
|
|
@ -283,7 +283,7 @@ pub(crate) fn interact(
|
||||||
drag_started,
|
drag_started,
|
||||||
dragged,
|
dragged,
|
||||||
drag_stopped,
|
drag_stopped,
|
||||||
contains_pointer,
|
|
||||||
hovered,
|
hovered,
|
||||||
|
contains_pointer,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -466,23 +466,23 @@ fn response_summary(response: &egui::Response, show_hovers: bool) -> String {
|
||||||
// These are in inverse logical/chonological order, because we show them in the ui that way:
|
// These are in inverse logical/chonological order, because we show them in the ui that way:
|
||||||
|
|
||||||
if response.triple_clicked_by(button) {
|
if response.triple_clicked_by(button) {
|
||||||
writeln!(new_info, "Triple-clicked{button_suffix}").ok();
|
writeln!(new_info, "Triple_clicked_by{button_suffix}").ok();
|
||||||
}
|
}
|
||||||
if response.double_clicked_by(button) {
|
if response.double_clicked_by(button) {
|
||||||
writeln!(new_info, "Double-clicked{button_suffix}").ok();
|
writeln!(new_info, "Double_clicked_by{button_suffix}").ok();
|
||||||
}
|
}
|
||||||
if response.clicked_by(button) {
|
if response.clicked_by(button) {
|
||||||
writeln!(new_info, "Clicked{button_suffix}").ok();
|
writeln!(new_info, "Clicked_by{button_suffix}").ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
if response.drag_stopped_by(button) {
|
if response.drag_stopped_by(button) {
|
||||||
writeln!(new_info, "Drag stopped{button_suffix}").ok();
|
writeln!(new_info, "Drag_stopped_by{button_suffix}").ok();
|
||||||
}
|
}
|
||||||
if response.dragged_by(button) {
|
if response.dragged_by(button) {
|
||||||
writeln!(new_info, "Dragged{button_suffix}").ok();
|
writeln!(new_info, "Dragged_by{button_suffix}").ok();
|
||||||
}
|
}
|
||||||
if response.drag_started_by(button) {
|
if response.drag_started_by(button) {
|
||||||
writeln!(new_info, "Drag started{button_suffix}").ok();
|
writeln!(new_info, "Drag_started_by{button_suffix}").ok();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue