(
widget: &PlotWidget,
data_min: Option<DVec2>,
data_max: Option<DVec2>,
)
| 940 | if zoom_x { |
| 941 | self.camera.position.x += render_delta.x; |
| 942 | } |
| 943 | if zoom_y { |
| 944 | self.camera.position.y += render_delta.y; |
| 945 | } |
| 946 | self.update_axis_links(); |
| 947 | } |
| 948 | |
| 949 | fn pan_by(&mut self, direction: PanDirection, fraction: f64) { |
| 950 | let delta = self.camera.half_extents * (2.0 * fraction); |
| 951 | let pan_delta = match direction { |
| 952 | PanDirection::Left => DVec2::new(-delta.x, 0.0), |
| 953 | PanDirection::Right => DVec2::new(delta.x, 0.0), |
| 954 | PanDirection::Up => DVec2::new(0.0, delta.y), |
| 955 | PanDirection::Down => DVec2::new(0.0, -delta.y), |
| 956 | }; |
| 957 | |
| 958 | self.camera.position += pan_delta; |
| 959 | self.update_axis_links(); |
| 960 | } |
| 961 | |
| 962 | fn cursor_world_data(&self, viewport: DVec2) -> Option<[f64; 2]> { |
no test coverage detected