pub struct Rect {
pub x: f32,
pub y: f32,
pub width: f32,
pub height: f32,
}Expand description
A rectangle in logical pixels: its top-left corner and its size.
Fields§
§x: f32The left edge.
y: f32The top edge.
width: f32The width.
height: f32The height.
Implementations§
Source§impl Rect
impl Rect
Sourcepub const fn new(x: f32, y: f32, width: f32, height: f32) -> Rect
pub const fn new(x: f32, y: f32, width: f32, height: f32) -> Rect
A rectangle with its top-left corner at x, y.
Sourcepub fn contains(&self, point: Point) -> bool
pub fn contains(&self, point: Point) -> bool
Whether point lies inside. The left and top edges count as inside,
the right and bottom edges don’t, so two rectangles that touch never
both contain a point.
Trait Implementations§
impl Copy for Rect
impl StructuralPartialEq for Rect
Auto Trait Implementations§
impl Forget for Rect
impl Freeze for Rect
impl Move for Rect
impl RefUnwindSafe for Rect
impl Send for Rect
impl Sync for Rect
impl Unpin for Rect
impl UnsafeUnpin for Rect
impl UnwindSafe for Rect
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more