equal
deleted
inserted
replaced
62 WindowEvent::CloseRequested => { |
62 WindowEvent::CloseRequested => { |
63 is_running = false; |
63 is_running = false; |
64 } |
64 } |
65 WindowEvent::MouseInput { button, state, .. } => { |
65 WindowEvent::MouseInput { button, state, .. } => { |
66 if let MouseButton::Right = button { |
66 if let MouseButton::Right = button { |
67 if let ElementState::Pressed = state { |
67 dragging = state == ElementState::Pressed; |
68 dragging = true; |
|
69 } else { |
|
70 dragging = false; |
|
71 } |
|
72 } |
68 } |
73 } |
69 } |
|
70 |
74 WindowEvent::MouseWheel { delta, .. } => { |
71 WindowEvent::MouseWheel { delta, .. } => { |
75 let zoom_change = match delta { |
72 let zoom_change = match delta { |
76 MouseScrollDelta::LineDelta(x, y) => y as f32 * 0.1f32, |
73 MouseScrollDelta::LineDelta(x, y) => y as f32 * 0.1f32, |
77 MouseScrollDelta::PixelDelta(delta) => { |
74 MouseScrollDelta::PixelDelta(delta) => { |
78 let physical = delta.to_physical(window.get_hidpi_factor()); |
75 let physical = delta.to_physical(window.get_hidpi_factor()); |