Remove redundant code

This commit is contained in:
Hanno Braun 2024-11-18 20:38:19 +01:00
parent 73476e5541
commit 0ad2699f6d

View File

@ -27,7 +27,6 @@ pub fn display(model: Model, invert_zoom: bool) -> Result<(), Error> {
invert_zoom, invert_zoom,
window: None, window: None,
viewer: None, viewer: None,
held_mouse_button: None,
}; };
event_loop.run_app(&mut display_state)?; event_loop.run_app(&mut display_state)?;
@ -56,7 +55,6 @@ struct DisplayState {
invert_zoom: bool, invert_zoom: bool,
window: Option<Window>, window: Option<Window>,
viewer: Option<Viewer>, viewer: Option<Viewer>,
held_mouse_button: Option<MouseButton>,
} }
impl ApplicationHandler for DisplayState { impl ApplicationHandler for DisplayState {
@ -125,11 +123,9 @@ impl ApplicationHandler for DisplayState {
WindowEvent::MouseInput { state, button, .. } => { WindowEvent::MouseInput { state, button, .. } => {
match state { match state {
ElementState::Pressed => { ElementState::Pressed => {
self.held_mouse_button = Some(button);
viewer.add_focus_point(); viewer.add_focus_point();
} }
ElementState::Released => { ElementState::Released => {
self.held_mouse_button = None;
viewer.remove_focus_point(); viewer.remove_focus_point();
} }
} }