rust/hwrunner/src/main.rs
changeset 14709 65c971417780
parent 14705 19122a329774
child 14714 4df1aac5f090
equal deleted inserted replaced
14708:19358c313ebb 14709:65c971417780
    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());