diff --git a/crates/egui/src/widgets/plot/mod.rs b/crates/egui/src/widgets/plot/mod.rs index f74f1d5f328..1fb51b81821 100644 --- a/crates/egui/src/widgets/plot/mod.rs +++ b/crates/egui/src/widgets/plot/mod.rs @@ -1083,6 +1083,9 @@ impl PlotUi { /// Scale the plot bounds around a position in screen coordinates. Can be useful for /// implementing alternative plot navigation methods. + /// The plot bounds are divided by `zoom_factor`, therefore: + /// `zoom_factor > 1.0` zooms in, i.e., reduces the visible range to show more detail. + /// `zoom_factor < 1.0` zooms out, i.e., increases the visible range to show more data. pub fn zoom_bounds(&mut self, zoom_factor: Vec2, center: Pos2) { self.last_screen_transform.zoom(zoom_factor, center); self.bounds_modified = true.into(); @@ -1090,6 +1093,9 @@ impl PlotUi { /// Scale the plot bounds around the hovered position, if any. Can be useful for implementing /// alternative plot navigation methods. + /// The plot bounds are divided by `zoom_factor`, therefore: + /// `zoom_factor > 1.0` zooms in, i.e., reduces the visible range to show more detail. + /// `zoom_factor < 1.0` zooms out, i.e., increases the visible range to show more data. pub fn zoom_bounds_around_hovered(&mut self, zoom_factor: Vec2) { if let Some(hover_pos) = self.response.hover_pos() { self.zoom_bounds(zoom_factor, hover_pos);