Zoom by a relative factor with the given screen position as center.
(&mut self, zoom_factor: Vec2, center: Pos2)
| 474 | |
| 475 | /// Zoom by a relative factor with the given screen position as center. |
| 476 | pub fn zoom(&mut self, zoom_factor: Vec2, center: Pos2) { |
| 477 | let center = self.value_from_position(center); |
| 478 | |
| 479 | let mut new_bounds = self.bounds; |
| 480 | new_bounds.zoom(zoom_factor, center); |
| 481 | |
| 482 | if new_bounds.is_valid() { |
| 483 | self.bounds = new_bounds; |
| 484 | } |
| 485 | } |
| 486 | |
| 487 | pub fn position_from_point_x(&self, value: f64) -> f32 { |
| 488 | remap( |
no test coverage detected