1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 21:30:03 -04:00

Refactor: make Rect members min/max public

This commit is contained in:
Emil Ernerfeldt
2020-04-25 15:45:38 +02:00
parent e26d08851f
commit cce048509f
10 changed files with 31 additions and 37 deletions

View File

@@ -318,8 +318,8 @@ impl std::fmt::Debug for Pos2 {
#[derive(Clone, Copy, Default, Eq, PartialEq, Deserialize, Serialize)]
pub struct Rect {
min: Pos2,
max: Pos2,
pub min: Pos2,
pub max: Pos2,
}
impl Rect {
@@ -366,7 +366,7 @@ impl Rect {
#[must_use]
pub fn translate(self, amnt: Vec2) -> Self {
Rect::from_min_size(self.min() + amnt, self.size())
Rect::from_min_size(self.min + amnt, self.size())
}
#[must_use]
@@ -405,12 +405,6 @@ impl Rect {
y: self.min.y + self.size().y / 2.0,
}
}
pub fn min(&self) -> Pos2 {
self.min
}
pub fn max(&self) -> Pos2 {
self.max
}
pub fn size(&self) -> Vec2 {
self.max - self.min
}