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

Minor improvements

This commit is contained in:
Emil Ernerfeldt
2019-02-10 20:56:59 +01:00
parent 2583fd2c52
commit da6d590908
4 changed files with 45 additions and 17 deletions

View File

@@ -134,6 +134,7 @@ impl Rect {
pub fn min(&self) -> Vec2 {
self.pos
}
pub fn max(&self) -> Vec2 {
self.pos + self.size
}
@@ -141,6 +142,12 @@ impl Rect {
pub fn size(&self) -> Vec2 {
self.size
}
pub fn width(&self) -> f32 {
self.size.x
}
pub fn height(&self) -> f32 {
self.size.y
}
// Convenience functions:
pub fn left_top(&self) -> Vec2 {