Struct freya_engine::prelude::IRect

#[repr(C)]
pub struct IRect { pub left: i32, pub top: i32, pub right: i32, pub bottom: i32, }

Fields§

§left: i32

The x coordinate of the rectangle’s left edge.

§top: i32

The y coordinate of the rectangle’s top edge.

§right: i32

The x coordinate of the rectangle’s right edge.

§bottom: i32

The y coordinate of the rectangle’s bottom edge.

Implementations§

§

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>

pub fn join(a: &IRect, b: &IRect) -> IRect

pub fn sort(&mut self)

pub fn sorted(&self) -> IRect

pub fn empty() -> &'static IRect

👎Deprecated since 0.27.0: removed without replacement

Trait Implementations§

§

impl AsRef<IRect> for IRect

§

fn as_ref(&self) -> &IRect

Converts this type into a shared reference of the (usually inferred) input type.
§

impl Clone for IRect

§

fn clone(&self) -> IRect

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

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

§

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 Contains<&IRect> for Handle<SkRegion>

§

fn contains(&self, rect: &IRect) -> bool

§

impl Contains<&IRect> for IRect

§

fn contains(&self, r: &IRect) -> bool

§

impl Contains<&IRect> for Rect

§

fn contains(&self, r: &IRect) -> bool

§

impl Contains<&Rect> for IRect

§

fn contains(&self, other: &Rect) -> bool

§

impl Contains<IPoint> for IRect

§

fn contains(&self, other: IPoint) -> bool

§

impl Contains<IRect> for IRect

§

fn contains(&self, other: IRect) -> bool

§

impl Contains<IRect> for Rect

§

fn contains(&self, r: IRect) -> bool

§

impl Contains<Rect> for IRect

§

fn contains(&self, other: Rect) -> bool

§

impl Debug for IRect

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for IRect

§

fn default() -> IRect

Returns the “default value” for a type. Read more
§

impl From<(IPoint, ISize)> for IRect

§

fn from(_: (IPoint, ISize)) -> IRect

Converts to this type from the input type.
§

impl From<IRect> for Rect

§

fn from(irect: IRect) -> Rect

Converts to this type from the input type.
§

impl Intersects<IRect> for Handle<SkRegion>

§

fn intersects(&self, rect: &IRect) -> bool

§

impl PartialEq for IRect

§

fn eq(&self, other: &IRect) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl QuickReject<IRect> for Handle<SkRegion>

§

fn quick_reject(&self, rect: &IRect) -> bool

§

impl RoundOut<IRect> for Rect

§

fn round_out(&self) -> IRect

§

impl Copy for IRect

§

impl Eq for IRect

§

impl StructuralEq for IRect

§

impl StructuralPartialEq for IRect

Auto Trait Implementations§

§

impl RefUnwindSafe for IRect

§

impl Send for IRect

§

impl Sync for IRect

§

impl Unpin for IRect

§

impl UnwindSafe for IRect

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<N, T> NativeTransmutableWrapper<N> for Twhere T: NativeTransmutable<N>,

§

fn wrap(native: N) -> T

§

fn unwrap(self) -> N

§

fn inner(&self) -> &N

§

fn inner_mut(&mut self) -> &mut N

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.