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

emath: add Rect::signed_distance_to_pos and Vec2::abs

This commit is contained in:
Emil Ernerfeldt
2022-04-04 11:24:08 +02:00
parent 5d19f381f9
commit 2d30bd751c
2 changed files with 16 additions and 0 deletions

View File

@@ -223,6 +223,12 @@ impl Vec2 {
vec2(self.x.ceil(), self.y.ceil())
}
#[must_use]
#[inline]
pub fn abs(self) -> Self {
vec2(self.x.abs(), self.y.abs())
}
/// True if all members are also finite.
#[inline(always)]
pub fn is_finite(self) -> bool {