Move code to match order of variants in enum

This commit is contained in:
Hanno Braun 2024-11-18 19:44:08 +01:00
parent 5b65b6cb98
commit 4b70d7f1a1

View File

@ -126,6 +126,9 @@ impl ApplicationHandler for DisplayState {
} }
_ => {} _ => {}
}, },
WindowEvent::CursorMoved { position, .. } => {
viewer.on_cursor_movement([position.x, position.y]);
}
WindowEvent::MouseInput { state, button, .. } => match state { WindowEvent::MouseInput { state, button, .. } => match state {
ElementState::Pressed => { ElementState::Pressed => {
self.held_mouse_button = Some(button); self.held_mouse_button = Some(button);
@ -136,9 +139,6 @@ impl ApplicationHandler for DisplayState {
viewer.remove_focus_point(); viewer.remove_focus_point();
} }
}, },
WindowEvent::CursorMoved { position, .. } => {
viewer.on_cursor_movement([position.x, position.y]);
}
WindowEvent::MouseWheel { .. } => viewer.add_focus_point(), WindowEvent::MouseWheel { .. } => viewer.add_focus_point(),
WindowEvent::RedrawRequested => { WindowEvent::RedrawRequested => {
viewer.draw(); viewer.draw();