pub struct MotionRect {
pub origin: MotionPoint,
pub size: MotionSize,
}Expand description
A renderer-neutral rectangle.
Fields§
§origin: MotionPointTop-left rectangle origin.
size: MotionSizeRectangle extent.
Implementations§
Source§impl MotionRect
impl MotionRect
Sourcepub const fn new(origin: MotionPoint, size: MotionSize) -> Self
pub const fn new(origin: MotionPoint, size: MotionSize) -> Self
Creates a rectangle from origin and size.
Sourcepub const fn top_left(self) -> MotionPoint
pub const fn top_left(self) -> MotionPoint
Returns the rectangle top-left point.
Sourcepub fn top_center(self) -> MotionPoint
pub fn top_center(self) -> MotionPoint
Returns the rectangle top-center point.
Sourcepub fn top_right(self) -> MotionPoint
pub fn top_right(self) -> MotionPoint
Returns the rectangle top-right point.
Sourcepub fn right_center(self) -> MotionPoint
pub fn right_center(self) -> MotionPoint
Returns the rectangle right-center point.
Sourcepub fn bottom_left(self) -> MotionPoint
pub fn bottom_left(self) -> MotionPoint
Returns the rectangle bottom-left point.
Sourcepub fn bottom_center(self) -> MotionPoint
pub fn bottom_center(self) -> MotionPoint
Returns the rectangle bottom-center point.
Sourcepub fn bottom_right(self) -> MotionPoint
pub fn bottom_right(self) -> MotionPoint
Returns the rectangle bottom-right point.
Sourcepub fn left_center(self) -> MotionPoint
pub fn left_center(self) -> MotionPoint
Returns the rectangle left-center point.
Trait Implementations§
Source§impl Clone for MotionRect
impl Clone for MotionRect
impl Copy for MotionRect
Source§impl Debug for MotionRect
impl Debug for MotionRect
Source§impl Default for MotionRect
impl Default for MotionRect
Source§impl PartialEq for MotionRect
impl PartialEq for MotionRect
impl StructuralPartialEq for MotionRect
Auto Trait Implementations§
impl Freeze for MotionRect
impl RefUnwindSafe for MotionRect
impl Send for MotionRect
impl Sync for MotionRect
impl Unpin for MotionRect
impl UnsafeUnpin for MotionRect
impl UnwindSafe for MotionRect
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