1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 13:50:04 -04:00

Add rudimentary support for gui windows that you can move around

This commit is contained in:
Emil Ernerfeldt
2020-04-17 14:26:36 +02:00
parent b26359d383
commit 1d3836ba80
10 changed files with 297 additions and 79 deletions

View File

@@ -149,6 +149,9 @@ impl Rect {
pub fn expand(self, amnt: f32) -> Self {
Rect::from_center_size(self.center(), self.size() + 2.0 * vec2(amnt, amnt))
}
pub fn translate(self, amnt: Vec2) -> Self {
Rect::from_min_size(self.min() + amnt, self.size())
}
pub fn contains(&self, p: Vec2) -> bool {
self.min.x <= p.x