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

Make Region::child_bounds private

This commit is contained in:
Emil Ernerfeldt
2020-05-05 08:15:20 +02:00
parent 2f9e70febf
commit fade508c15
4 changed files with 33 additions and 11 deletions

View File

@@ -358,12 +358,18 @@ impl Rect {
}
}
/// Expand by this much in each direction
/// Expand by this much in each direction, keeping the center
#[must_use]
pub fn expand(self, amnt: f32) -> Self {
Rect::from_center_size(self.center(), self.size() + 2.0 * vec2(amnt, amnt))
}
/// Expand by this much in each direction, keeping the center
#[must_use]
pub fn expand2(self, amnt: Vec2) -> Self {
Rect::from_center_size(self.center(), self.size() + 2.0 * amnt)
}
#[must_use]
pub fn translate(self, amnt: Vec2) -> Self {
Rect::from_min_size(self.min + amnt, self.size())