pub struct Rect {
pub x: f32,
pub y: f32,
pub width: f32,
pub height: f32,
}Expand description
Represents a rectangle.
§Usage
// Rects can be defined via the struct
let rect = Rect { x: 1.0, y: 1.0, width: 5.0, height: 5.0 };
// And via a tuple as well (x, y, width, height):
let rect_ = (1.0, 1.0, 5.0, 5.0).into();
assert_eq!(rect, rect_);Tip: Many functions in fae take Into<Rect> as a parameter, in
which case it is often cleaner to pass in a tuple, like rect_
above, but without the .into().
Fields§
§x: f32The x-coordinate of the top-left corner of this rectangle.
y: f32The y-coordinate of the top-left corner of this rectangle.
width: f32The width of this rectangle.
height: f32The height of this rectangle.
Trait Implementations§
impl Copy for Rect
impl StructuralPartialEq for Rect
Auto Trait Implementations§
impl Freeze 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