mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 06:10:06 -04:00
Plot auto-bounds API improvement (part 1/2): clean-up (#3587)
Part 1 of 2 of adding a better API for egui_plot's auto-bounds feature. In this PR: - change the `Plot` builder struct field to `default_auto_bounds` (was `auto_bounds`) - change the `Plot` state field to `auto_bounds` (was `bounds_modified`) - minor improvements to `Vec2b`
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/// Two bools, one for each axis (X and Y).
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
|
||||
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
|
||||
pub struct Vec2b {
|
||||
pub x: bool,
|
||||
@@ -58,3 +58,15 @@ impl std::ops::IndexMut<usize> for Vec2b {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::ops::Not for Vec2b {
|
||||
type Output = Self;
|
||||
|
||||
#[inline]
|
||||
fn not(self) -> Self::Output {
|
||||
Self {
|
||||
x: !self.x,
|
||||
y: !self.y,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user