#[repr(C)]pub struct IRect {
pub left: i32,
pub top: i32,
pub right: i32,
pub bottom: i32,
}Available on crate feature
engine only.Fields§
§left: i32The x coordinate of the rectangle’s left edge.
top: i32The y coordinate of the rectangle’s top edge.
right: i32The x coordinate of the rectangle’s right edge.
bottom: i32The y coordinate of the rectangle’s bottom edge.
Implementations§
Source§impl IRect
impl IRect
pub const fn new(left: i32, top: i32, right: i32, bottom: i32) -> IRect
pub const fn new_empty() -> IRect
pub fn from_wh(w: i32, h: i32) -> IRect
pub fn from_size(size: impl Into<ISize>) -> IRect
pub fn from_pt_size(pt: impl Into<IPoint>, size: impl Into<ISize>) -> IRect
pub const fn from_ltrb(l: i32, t: i32, r: i32, b: i32) -> IRect
pub fn from_xywh(x: i32, y: i32, w: i32, h: i32) -> IRect
pub const fn left(&self) -> i32
pub const fn top(&self) -> i32
pub const fn right(&self) -> i32
pub const fn bottom(&self) -> i32
pub const fn x(&self) -> i32
pub const fn y(&self) -> i32
pub const fn width(&self) -> i32
pub const fn height(&self) -> i32
pub const fn size(&self) -> ISize
pub const fn width_64(&self) -> i64
pub const fn height_64(&self) -> i64
pub fn is_empty_64(&self) -> bool
pub fn is_empty(&self) -> bool
pub fn set_empty(&mut self)
pub fn set_ltrb(&mut self, left: i32, top: i32, right: i32, bottom: i32)
pub fn set_xywh(&mut self, x: i32, y: i32, w: i32, h: i32)
pub fn set_wh(&mut self, width: i32, height: i32)
pub fn set_size(&mut self, size: impl Into<ISize>)
pub fn with_offset(&self, delta: impl Into<IPoint>) -> IRect
pub fn with_inset(&self, delta: impl Into<IPoint>) -> IRect
pub fn with_outset(&self, delta: impl Into<IPoint>) -> IRect
pub fn offset(&mut self, delta: impl Into<IPoint>)
pub fn offset_to(&mut self, new_p: impl Into<IPoint>)
pub fn with_offset_to(&self, new_p: impl Into<IPoint>) -> IRect
pub fn inset(&mut self, delta: impl Into<IPoint>)
pub fn outset(&mut self, delta: impl Into<IPoint>)
pub fn with_adjustment(&self, d_l: i32, d_t: i32, d_r: i32, d_b: i32) -> IRect
pub fn adjust(&mut self, d_l: i32, d_t: i32, d_r: i32, d_b: i32)
pub fn contains_no_empty_check(&self, r: &IRect) -> bool
pub fn intersect(a: &IRect, b: &IRect) -> Option<IRect>
pub fn intersects(a: &IRect, b: &IRect) -> bool
pub fn intersect_no_empty_check_(a: &IRect, b: &IRect) -> Option<IRect>
Sourcepub fn join(a: &IRect, b: &IRect) -> IRect
pub fn join(a: &IRect, b: &IRect) -> IRect
Returns the union of a and b.
Has no effect if b is empty. Otherwise, if a is empty, returns b.
The C++ mutating variant join(const SkIRect&) is not wrapped; this static version
returns a new rectangle instead.
arectangle to joinbexpansion rectangle
Example (C++): https://fiddle.skia.org/c/@IRect_join_2
pub fn sort(&mut self)
pub fn sorted(&self) -> IRect
pub fn as_i32s(&self) -> &[i32]
pub fn empty() -> &'static IRect
👎Deprecated since 0.27.0:
removed without replacement
Trait Implementations§
Source§impl Combine<Handle<SkRegion>, IRect> for Handle<SkRegion>
impl Combine<Handle<SkRegion>, IRect> for Handle<SkRegion>
fn combine( region: &Handle<SkRegion>, op: SkRegion_Op, rect: &IRect, ) -> Handle<SkRegion>
fn difference(a: &A, b: &B) -> Self
fn intersect(a: &A, b: &B) -> Self
fn xor(a: &A, b: &B) -> Self
fn union(a: &A, b: &B) -> Self
fn reverse_difference(a: &A, b: &B) -> Self
fn replace(a: &A, b: &B) -> Self
Source§impl Combine<IRect, Handle<SkRegion>> for Handle<SkRegion>
impl Combine<IRect, Handle<SkRegion>> for Handle<SkRegion>
fn combine( rect: &IRect, op: SkRegion_Op, region: &Handle<SkRegion>, ) -> Handle<SkRegion>
fn difference(a: &A, b: &B) -> Self
fn intersect(a: &A, b: &B) -> Self
fn xor(a: &A, b: &B) -> Self
fn union(a: &A, b: &B) -> Self
fn reverse_difference(a: &A, b: &B) -> Self
fn replace(a: &A, b: &B) -> Self
impl Copy for IRect
impl Eq for IRect
Source§impl QuickReject<IRect> for Handle<SkRegion>
impl QuickReject<IRect> for Handle<SkRegion>
fn quick_reject(&self, rect: &IRect) -> bool
impl StructuralPartialEq for IRect
Auto Trait Implementations§
impl Forget for IRect
impl Freeze for IRect
impl Move for IRect
impl RefUnwindSafe for IRect
impl Send for IRect
impl Sync for IRect
impl Unpin for IRect
impl UnsafeUnpin for IRect
impl UnwindSafe for IRect
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
impl<T> Brush for T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ComponentProps for T
impl<T> ComponentProps for T
fn changed(&self, other: &(dyn ComponentProps + 'static)) -> bool
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoReadable<T> for Twhere
T: 'static + PartialEq,
impl<T> IntoReadable<T> for Twhere
T: 'static + PartialEq,
fn into_readable(self) -> Readable<T>
Source§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert
Source§impl<N, T> NativeTransmutableWrapper<N> for Twhere
T: NativeTransmutable<N>,
impl<N, T> NativeTransmutableWrapper<N> for Twhere
T: NativeTransmutable<N>,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().Source§impl<T> ResetDiscriminant<T> for Twhere
T: Copy,
impl<T> ResetDiscriminant<T> for Twhere
T: Copy,
Source§fn discriminant(&self) -> T
fn discriminant(&self) -> T
Value based on which equality for the reset will be determined.