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

Method zoom_bounds_around_hovered

egui_plot/src/plot.rs:1976–1980  ·  view source on GitHub ↗

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 out, i.e., increases the visible range to show more data. - `zoom_factor > 1.0` zooms in, i.e., reduces the visible range to show more detail.

(&mut self, zoom_factor: Vec2)

Source from the content-addressed store, hash-verified

1974 /// - `zoom_factor > 1.0` zooms in, i.e., reduces the visible range to show
1975 /// more detail.
1976 pub fn zoom_bounds_around_hovered(&mut self, zoom_factor: Vec2) {
1977 if let Some(hover_pos) = self.pointer_coordinate() {
1978 self.zoom_bounds(zoom_factor, hover_pos);
1979 }
1980 }
1981
1982 /// The pointer position in plot coordinates. Independent of whether the
1983 /// pointer is in the plot area.

Callers 1

show_plotMethod · 0.80

Calls 2

pointer_coordinateMethod · 0.80
zoom_boundsMethod · 0.80

Tested by

no test coverage detected