MCPcopy Create free account
hub / github.com/emilk/egui_plot / zoom

Method zoom

egui_plot/src/axis.rs:476–485  ·  view source on GitHub ↗

Zoom by a relative factor with the given screen position as center.

(&mut self, zoom_factor: Vec2, center: Pos2)

Source from the content-addressed store, hash-verified

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(

Callers 2

compute_boundsMethod · 0.45
handle_interactionsMethod · 0.45

Calls 2

value_from_positionMethod · 0.80
is_validMethod · 0.80

Tested by

no test coverage detected