pub struct NonZeroRect { /* private fields */ }
Expand description
Implementations§
source§impl NonZeroRect
impl NonZeroRect
sourcepub fn from_ltrb(
left: f32,
top: f32,
right: f32,
bottom: f32,
) -> Option<NonZeroRect>
pub fn from_ltrb( left: f32, top: f32, right: f32, bottom: f32, ) -> Option<NonZeroRect>
Creates new NonZeroRect
.
sourcepub fn from_xywh(x: f32, y: f32, w: f32, h: f32) -> Option<NonZeroRect>
pub fn from_xywh(x: f32, y: f32, w: f32, h: f32) -> Option<NonZeroRect>
Creates new NonZeroRect
.
sourcepub fn translate_to(&self, x: f32, y: f32) -> Option<NonZeroRect>
pub fn translate_to(&self, x: f32, y: f32) -> Option<NonZeroRect>
Translates the rect to the specified position.
sourcepub fn transform(&self, ts: Transform) -> Option<NonZeroRect>
pub fn transform(&self, ts: Transform) -> Option<NonZeroRect>
Transforms the rect using the provided Transform
.
This method is expensive.
sourcepub fn bbox_transform(&self, bbox: NonZeroRect) -> NonZeroRect
pub fn bbox_transform(&self, bbox: NonZeroRect) -> NonZeroRect
Applies a bounding box transform.
sourcepub fn to_int_rect(&self) -> IntRect
pub fn to_int_rect(&self) -> IntRect
Converts into IntRect
.
Trait Implementations§
source§impl Clone for NonZeroRect
impl Clone for NonZeroRect
source§fn clone(&self) -> NonZeroRect
fn clone(&self) -> NonZeroRect
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for NonZeroRect
impl Debug for NonZeroRect
source§impl PartialEq for NonZeroRect
impl PartialEq for NonZeroRect
impl Copy for NonZeroRect
impl StructuralPartialEq for NonZeroRect
Auto Trait Implementations§
impl Freeze for NonZeroRect
impl RefUnwindSafe for NonZeroRect
impl Send for NonZeroRect
impl Sync for NonZeroRect
impl Unpin for NonZeroRect
impl UnwindSafe for NonZeroRect
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)