#[repr(C)]pub struct Rect {
pub origin: Point,
pub size: Size,
}Fields§
§origin: Point§size: SizeImplementations§
Source§impl Rect
impl Rect
pub fn with_aspect_ratio_inside_rect( aspect_ratio: Size, bounding_rect: Rect, ) -> Self
Source§impl Rect
impl Rect
pub const fn zero() -> Self
pub fn null() -> Self
Sourcepub fn dictionary_representaion(&self) -> R<Dictionary>
pub fn dictionary_representaion(&self) -> R<Dictionary>
use cidre::cg;
let d = cg::Rect::zero().dictionary_representaion();
assert_eq!(d.len(), 4);pub fn from_dictionary_representation(dict: &Dictionary) -> Option<Self>
pub const fn new(x: Float, y: Float, width: Float, height: Float) -> Self
pub const fn with_size(width: Float, height: Float) -> Self
pub const fn max_x(&self) -> Float
pub const fn max_y(&self) -> Float
pub const fn min_x(&self) -> Float
pub const fn min_y(&self) -> Float
pub const fn x(&self) -> Float
pub const fn y(&self) -> Float
pub const fn width(&self) -> Float
pub const fn height(&self) -> Float
Sourcepub fn standardized(&self) -> Self
pub fn standardized(&self) -> Self
Standardize rect – i.e., convert it to an equivalent rect which has positive width and height.
pub fn contains_point(&self, point: &Point) -> bool
pub fn contains_rect(&self, other: &Self) -> bool
pub fn union(&self, other: &Self) -> Rect
pub fn intersects_rect(&self, other: &Self) -> bool
pub fn geometry_eq(&self, other: &Self) -> bool
pub const fn is_empty(&self) -> bool
pub fn is_infinite(&self) -> bool
pub fn is_null(&self) -> bool
Source§impl Rect
impl Rect
pub fn apply_affine_transform(&self, t: &AffineTransform) -> Self
Trait Implementations§
impl Copy for Rect
Source§impl PartialOrd for Rect
impl PartialOrd for Rect
impl StructuralPartialEq for Rect
Auto Trait Implementations§
impl Freeze for Rect
impl RefUnwindSafe for Rect
impl Send for Rect
impl Sync for Rect
impl Unpin for Rect
impl UnsafeUnpin for Rect
impl UnwindSafe for Rect
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