Prepare for follow-on change

This commit is contained in:
Hanno Braun 2024-11-18 20:34:57 +01:00
parent 96204d4174
commit 4a46455826

View File

@ -91,8 +91,10 @@ impl Viewer {
y: -(y / height * 2. - 1.) / aspect_ratio, y: -(y / height * 2. - 1.) / aspect_ratio,
}; };
let event = match (self.cursor, self.most_recent_mouse_button) { let event = if let (Some(cursor_old), Some(button)) =
(Some(cursor_old), Some(button)) => match button { (self.cursor, self.most_recent_mouse_button)
{
match button {
MouseButton::Left => { MouseButton::Left => {
let diff_x = cursor_new.x - cursor_old.x; let diff_x = cursor_new.x - cursor_old.x;
let diff_y = cursor_new.y - cursor_old.y; let diff_y = cursor_new.y - cursor_old.y;
@ -121,8 +123,9 @@ impl Viewer {
} }
None None
} }
}, }
_ => None, } else {
None
}; };
if let Some(event) = event { if let Some(event) = event {
self.handle_input_event(event); self.handle_input_event(event);