Commit 69d5e03 2 people authored and committed
1 parent b85fe0d commit 69d5e03 Copy full SHA for 69d5e03
File tree 2 files changed +9
-0
lines changed
crates/egui/src/widgets/plot
2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -1269,6 +1269,11 @@ impl PlotUi {
1269
1269
* self . last_screen_transform . bounds ( )
1270
1270
}
1271
1271
1272
+ /// Set the plot bounds. Can be useful for implementing alternative plot navigation methods.
1273
+ pub fn set_plot_bounds ( & mut self , plot_bounds : PlotBounds ) {
1274
+ self . last_screen_transform . set_bounds ( plot_bounds) ;
1275
+ }
1276
+
1272
1277
/// Move the plot bounds. Can be useful for implementing alternative plot navigation methods.
1273
1278
pub fn translate_bounds ( & mut self , delta_pos : Vec2 ) {
1274
1279
self . last_screen_transform . translate_bounds ( delta_pos) ;
Original file line number Diff line number Diff line change @@ -18,6 +18,10 @@ impl PlotBounds {
18
18
max : [ -f64:: INFINITY ; 2 ] ,
19
19
} ;
20
20
21
+ pub fn from_min_max ( min : [ f64 ; 2 ] , max : [ f64 ; 2 ] ) -> Self {
22
+ Self { min, max }
23
+ }
24
+
21
25
pub fn min ( & self ) -> [ f64 ; 2 ] {
22
26
self . min
23
27
}
You can’t perform that action at this time.
0 commit comments