#[repr(C)]pub struct Rect {
pub x: f32,
pub y: f32,
pub w: f32,
pub h: f32,
}Fields§
§x: f32§y: f32§w: f32§h: f32Implementations§
Source§impl Rect
impl Rect
Sourcepub fn to_value(self) -> Value
pub fn to_value(self) -> Value
{x, y, w, h} — a rect as a readback spells it: a caret, a
scroller’s box, a window’s anchor.
pub fn new(x: f32, y: f32, w: f32, h: f32) -> Self
pub fn from_pos_size(pos: Vec2, size: Size) -> Self
pub fn contains(&self, p: Vec2) -> bool
pub fn scaled(&self, s: f32) -> Rect
pub fn intersect(&self, other: &Rect) -> Rect
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