[−][src]Struct skia_safe::Rect
Fields
left: scalar
top: scalar
right: scalar
bottom: scalar
Methods
impl Rect
[src]
pub fn new(left: scalar, top: scalar, right: scalar, bottom: scalar) -> Self
[src]
pub fn new_empty() -> Self
[src]
pub fn from_wh(w: scalar, h: scalar) -> Self
[src]
pub fn from_iwh(w: i32, h: i32) -> Self
[src]
pub fn from_size(size: impl Into<Size>) -> Self
[src]
pub fn from_xywh(x: scalar, y: scalar, w: scalar, h: scalar) -> Self
[src]
pub fn from_point_and_size(p: impl Into<Point>, sz: impl Into<Size>) -> Self
[src]
pub fn from_isize(isize: impl Into<ISize>) -> Self
[src]
pub fn from_irect(irect: impl AsRef<IRect>) -> Self
[src]
pub fn is_empty(&self) -> bool
[src]
pub fn is_sorted(&self) -> bool
[src]
pub fn is_finite(&self) -> bool
[src]
pub fn left_top(&self) -> Point
[src]
Deprecated since 0.12.0:
removed without replacement
pub fn x(&self) -> scalar
[src]
pub fn y(&self) -> scalar
[src]
pub fn left(&self) -> scalar
[src]
pub fn top(&self) -> scalar
[src]
pub fn right(&self) -> scalar
[src]
pub fn bottom(&self) -> scalar
[src]
pub fn size(&self) -> Size
[src]
pub fn width(&self) -> scalar
[src]
pub fn height(&self) -> scalar
[src]
pub fn center(&self) -> Point
[src]
pub fn center_x(&self) -> scalar
[src]
pub fn center_y(&self) -> scalar
[src]
pub fn to_quad(&self) -> [Point; 4]
[src]
pub fn set_empty(&mut self)
[src]
pub fn set_irect(&mut self, irect: impl AsRef<IRect>)
[src]
pub fn set(&mut self, left: scalar, top: scalar, right: scalar, bottom: scalar)
[src]
pub fn set_ltrb(
&mut self,
left: scalar,
top: scalar,
right: scalar,
bottom: scalar
)
[src]
&mut self,
left: scalar,
top: scalar,
right: scalar,
bottom: scalar
)
pub fn iset(&mut self, left: i32, top: i32, right: i32, bottom: i32)
[src]
pub fn iset_wh(&mut self, width: i32, height: i32)
[src]
pub fn set_bounds(&mut self, points: &[Point])
[src]
pub fn set_bounds_check(&mut self, points: &[Point]) -> bool
[src]
pub fn set_bounds_no_check(&mut self, points: &[Point])
[src]
pub fn set_bounds2(&mut self, p0: impl Into<Point>, p1: impl Into<Point>)
[src]
pub fn from_bounds(points: &[Point]) -> Option<Self>
[src]
pub fn set_xywh(&mut self, x: scalar, y: scalar, width: scalar, height: scalar)
[src]
pub fn set_wh(&mut self, w: scalar, h: scalar)
[src]
pub fn with_offset(&self, d: impl Into<Vector>) -> Self
[src]
pub fn with_inset(&self, d: impl Into<Vector>) -> Self
[src]
pub fn with_outset(&self, d: impl Into<Vector>) -> Self
[src]
pub fn offset(&mut self, d: impl Into<Vector>)
[src]
pub fn offset_to(&mut self, new_p: impl Into<Point>)
[src]
pub fn with_offset_to(&self, new_p: impl Into<Point>) -> Self
[src]
pub fn inset(&mut self, d: impl Into<Vector>)
[src]
pub fn outset(&mut self, d: impl Into<Vector>)
[src]
pub fn intersect(&mut self, r: impl AsRef<Rect>) -> bool
[src]
pub fn intersect_ltrb(
&mut self,
left: scalar,
top: scalar,
right: scalar,
bottom: scalar
) -> bool
[src]
&mut self,
left: scalar,
top: scalar,
right: scalar,
bottom: scalar
) -> bool
#[must_use]
pub fn intersect2(&mut self, a: impl AsRef<Rect>, b: impl AsRef<Rect>) -> bool
[src]
pub fn intersects_ltrb(
&self,
left: scalar,
top: scalar,
right: scalar,
bottom: scalar
) -> bool
[src]
&self,
left: scalar,
top: scalar,
right: scalar,
bottom: scalar
) -> bool
pub fn intersects(&self, r: impl AsRef<Rect>) -> bool
[src]
pub fn intersects2(a: impl AsRef<Rect>, b: impl AsRef<Rect>) -> bool
[src]
pub fn join_ltrb(
&mut self,
left: scalar,
top: scalar,
right: scalar,
bottom: scalar
)
[src]
&mut self,
left: scalar,
top: scalar,
right: scalar,
bottom: scalar
)
pub fn join(&mut self, r: impl AsRef<Rect>)
[src]
pub fn join2(a: impl AsRef<Rect>, b: impl AsRef<Rect>) -> Rect
[src]
pub fn join_non_empty_arg(&mut self, r: impl AsRef<Rect>)
[src]
pub fn join_possibly_empty_rect(&mut self, r: impl AsRef<Rect>)
[src]
#[must_use]
pub fn round(&self) -> IRect
[src]
#[must_use]
pub fn round_in(&self) -> IRect
[src]
pub fn sort(&mut self)
[src]
#[must_use]
pub fn sorted(&self) -> Rect
[src]
pub fn as_scalars(&self) -> &[scalar; 4]
[src]
pub fn dump(&self, as_hex: impl Into<Option<bool>>)
[src]
pub fn dump_hex(&self)
[src]
Trait Implementations
impl RoundOut<IRect> for Rect
[src]
impl RoundOut<Rect> for Rect
[src]
impl<'_> Contains<&'_ Rect> for IRect
[src]
impl Contains<Rect> for IRect
[src]
impl Contains<Point> for Rect
[src]
impl Contains<Rect> for Rect
[src]
impl Contains<IRect> for Rect
[src]
impl QuickReject<Rect> for Canvas
[src]
fn quick_reject(&self, other: &Rect) -> bool
[src]
impl AsRef<Rect> for Rect
[src]
impl Default for Rect
[src]
impl Clone for Rect
[src]
impl PartialEq<Rect> for Rect
[src]
impl From<(Point, Size)> for Rect
[src]
impl From<ISize> for Rect
[src]
impl From<IRect> for Rect
[src]
impl Copy for Rect
[src]
impl Debug for Rect
[src]
Auto Trait Implementations
impl Unpin for Rect
impl Sync for Rect
impl Send for Rect
impl UnwindSafe for Rect
impl RefUnwindSafe for Rect
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,