mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 14:20:04 -04:00
Add method to set a Plot's margin (#1308)
This commit is contained in:
@@ -287,6 +287,14 @@ impl Plot {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Set the side margin as a fraction of the plot size.
|
||||||
|
///
|
||||||
|
/// For instance, a value of `0.1` will add 10% space on both sides.
|
||||||
|
pub fn set_margin_fraction(mut self, margin_fraction: Vec2) -> Self {
|
||||||
|
self.margin_fraction = margin_fraction;
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
/// Whether to allow zooming in the plot by dragging out a box with the secondary mouse button.
|
/// Whether to allow zooming in the plot by dragging out a box with the secondary mouse button.
|
||||||
///
|
///
|
||||||
/// Default: `true`.
|
/// Default: `true`.
|
||||||
|
|||||||
Reference in New Issue
Block a user