()
| 102 | |
| 103 | impl Default for PlotControls { |
| 104 | fn default() -> Self { |
| 105 | let mut controls = Self { |
| 106 | drag: HashMap::new(), |
| 107 | scroll: HashMap::new(), |
| 108 | click: HashMap::new(), |
| 109 | double_click: HashMap::new(), |
| 110 | key: HashMap::new(), |
| 111 | drag_delta_threshold: 4.0, |
| 112 | selection_padding: 0.02, |
| 113 | }; |
| 114 | |
| 115 | controls |
| 116 | .bind_drag(mouse::Button::Left, DragAction::Pan) |
| 117 | .bind_drag(mouse::Button::Right, DragAction::BoxZoom) |
| 118 | .bind_scroll(keyboard::Modifiers::NONE, ScrollAction::Pan) |
| 119 | .bind_scroll(keyboard::Modifiers::CTRL, ScrollAction::Zoom) |
| 120 | .bind_click(mouse::Button::Left, ClickAction::Pick) |
| 121 | .bind_double_click(mouse::Button::Left, ClickAction::Autoscale) |
| 122 | .bind_key( |
| 123 | keyboard::Key::Named(keyboard::key::Named::Escape), |
| 124 | KeyAction::ClearPick, |
| 125 | ); |
| 126 | |
| 127 | controls.bind_arrow_pan(0.1); |
| 128 | controls |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | impl PlotControls { |
nothing calls this directly
no test coverage detected