1
0
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:
Antoine Beyeler
2023-11-21 11:22:19 +01:00
committed by GitHub
parent 78a93f81f0
commit f20b7b43bf
2 changed files with 44 additions and 32 deletions

View File

@@ -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,
}
}
}