Update `pathfinder_geometry`
This commit is contained in:
parent
23c171fb6f
commit
b8055c38c1
|
@ -293,16 +293,9 @@ impl MulAssign<Vector2F> for LineSegment2F {
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, Default)]
|
#[derive(Clone, Copy, Debug, Default)]
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct LineSegmentU4 {
|
pub struct LineSegmentU16 {
|
||||||
pub from: u8,
|
pub from_x: u16,
|
||||||
pub to: u8,
|
pub from_y: u16,
|
||||||
}
|
pub to_x: u16,
|
||||||
|
pub to_y: u16,
|
||||||
#[derive(Clone, Copy, Debug, Default)]
|
|
||||||
#[repr(C)]
|
|
||||||
pub struct LineSegmentU8 {
|
|
||||||
pub from_x: u8,
|
|
||||||
pub from_y: u8,
|
|
||||||
pub to_x: u8,
|
|
||||||
pub to_y: u8,
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -327,6 +327,11 @@ impl RectI {
|
||||||
self.0.w() - self.0.y()
|
self.0.w() - self.0.y()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
pub fn area(self) -> i32 {
|
||||||
|
self.width() * self.height()
|
||||||
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn upper_right(&self) -> Vector2I {
|
pub fn upper_right(&self) -> Vector2I {
|
||||||
Vector2I(self.0.zy())
|
Vector2I(self.0.zy())
|
||||||
|
|
|
@ -349,6 +349,11 @@ impl Vector2I {
|
||||||
Vector2I(self.0.max(other.0))
|
Vector2I(self.0.max(other.0))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
pub fn area(self) -> i32 {
|
||||||
|
self.x() * self.y()
|
||||||
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn to_f32(self) -> Vector2F {
|
pub fn to_f32(self) -> Vector2F {
|
||||||
Vector2F(self.0.to_f32x2())
|
Vector2F(self.0.to_f32x2())
|
||||||
|
|
Loading…
Reference in New Issue