mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 05:40:03 -04:00
Minor API tweaks
This commit is contained in:
@@ -117,6 +117,11 @@ impl Rect {
|
||||
}
|
||||
}
|
||||
|
||||
/// Expand by this much in each direction
|
||||
pub fn expand(self, amnt: f32) -> Self {
|
||||
Rect::from_center_size(self.center(), self.size() + 2.0 * vec2(amnt, amnt))
|
||||
}
|
||||
|
||||
pub fn contains(&self, p: Vec2) -> bool {
|
||||
self.pos.x <= p.x
|
||||
&& p.x <= self.pos.x + self.size.x
|
||||
|
||||
Reference in New Issue
Block a user