Struct tiny_skia_path::ScreenIntRect
source · pub struct ScreenIntRect { /* private fields */ }
Expand description
A screen IntRect
.
Guarantees
- X and Y are in 0..=i32::MAX range.
- Width and height are in 1..=i32::MAX range.
- x+width and y+height does not overflow.
Implementations§
source§impl ScreenIntRect
impl ScreenIntRect
sourcepub fn from_xywh(x: u32, y: u32, width: u32, height: u32) -> Option<Self>
pub fn from_xywh(x: u32, y: u32, width: u32, height: u32) -> Option<Self>
Creates a new ScreenIntRect
.
sourcepub const fn from_xywh_safe(
x: u32,
y: u32,
width: NonZeroU32,
height: NonZeroU32
) -> Self
pub const fn from_xywh_safe(
x: u32,
y: u32,
width: NonZeroU32,
height: NonZeroU32
) -> Self
Creates a new ScreenIntRect
.
sourcepub fn width_safe(&self) -> NonZeroU32
pub fn width_safe(&self) -> NonZeroU32
Returns rect’s width.
sourcepub fn contains(&self, other: &Self) -> bool
pub fn contains(&self, other: &Self) -> bool
Checks that the rect is completely includes other
Rect.
sourcepub fn to_int_rect(&self) -> IntRect
pub fn to_int_rect(&self) -> IntRect
Converts into a IntRect
.
Trait Implementations§
source§impl Clone for ScreenIntRect
impl Clone for ScreenIntRect
source§fn clone(&self) -> ScreenIntRect
fn clone(&self) -> ScreenIntRect
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 ScreenIntRect
impl Debug for ScreenIntRect
source§impl PartialEq<ScreenIntRect> for ScreenIntRect
impl PartialEq<ScreenIntRect> for ScreenIntRect
source§fn eq(&self, other: &ScreenIntRect) -> bool
fn eq(&self, other: &ScreenIntRect) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.