Synthesize a mouse moved event also when the mouse is dragged

This commit is contained in:
Antonio Scandurra 2021-08-27 16:31:12 +02:00
parent 2cd21d1da8
commit a9963f1b32

View File

@ -139,8 +139,11 @@ impl Presenter {
pub fn dispatch_event(&mut self, event: Event, cx: &mut MutableAppContext) {
if let Some(root_view_id) = cx.root_view_id(self.window_id) {
if matches!(event, Event::MouseMoved { .. }) {
self.last_mouse_moved_event = Some(event.clone());
match event {
Event::MouseMoved { position, .. } | Event::LeftMouseDragged { position } => {
self.last_mouse_moved_event = Some(Event::MouseMoved { position });
}
_ => {}
}
let mut event_cx = EventContext {