Skip to content

Commit

Permalink
Allow for changing of plot bounds from PlotUI (#2145)
Browse files Browse the repository at this point in the history
  • Loading branch information
Raymi306 authored Oct 13, 2022
1 parent ae5294e commit a1f6f68
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/egui/src/widgets/plot/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,11 @@ impl PlotUi {
*self.last_screen_transform.bounds()
}

/// Move the plot bounds. Can be useful for implementing alternative plot navigation methods.
pub fn translate_bounds(&mut self, delta_pos: Vec2) {
self.last_screen_transform.translate_bounds(delta_pos);
}

/// Returns `true` if the plot area is currently hovered.
pub fn plot_hovered(&self) -> bool {
self.response.hovered()
Expand Down

0 comments on commit a1f6f68

Please sign in to comment.