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

Implement window resizing

This commit is contained in:
Emil Ernerfeldt
2020-04-19 23:34:34 +02:00
parent 1be828bbe3
commit 388132ba93
8 changed files with 202 additions and 31 deletions

View File

@@ -43,6 +43,26 @@ impl Vec2 {
pub fn angled(angle: f32) -> Vec2 {
vec2(angle.cos(), angle.sin())
}
pub fn floor(self) -> Self {
vec2(self.x.floor(), self.y.floor())
}
pub fn round(self) -> Self {
vec2(self.x.round(), self.y.round())
}
pub fn ceil(self) -> Self {
vec2(self.x.ceil(), self.y.ceil())
}
pub fn min(self, other: Vec2) -> Self {
vec2(self.x.min(other.x), self.y.min(other.y))
}
pub fn max(self, other: Vec2) -> Self {
vec2(self.x.max(other.x), self.y.max(other.y))
}
}
impl std::ops::Neg for Vec2 {