pub type IntRect = Rect<i32>;
Expand description
A Rect
of i32
.
Aliased Type§
struct IntRect {
pub left: i32,
pub top: i32,
pub width: i32,
pub height: i32,
}
Fields§
§left: i32
Left coordinate of the rectangle.
top: i32
Top coordinate of the rectangle.
width: i32
Width of the rectangle.
height: i32
Height of the rectangle.
Implementations
Source§impl<T: PartialOrd + Add<Output = T> + Sub<Output = T> + Copy> Rect<T>
impl<T: PartialOrd + Add<Output = T> + Sub<Output = T> + Copy> Rect<T>
Sourcepub fn contains(self, point: Vector2<T>) -> bool
pub fn contains(self, point: Vector2<T>) -> bool
Check if a point is inside the rectangle’s area.
Sourcepub fn intersects(self, other: &Rect<T>) -> Option<Rect<T>>
pub fn intersects(self, other: &Rect<T>) -> Option<Rect<T>>
Check the intersection between two rectangles.
If the rectangles intersect, returns Some filled with the intersection of the two rectangles. Otherwise, returns None.