#[repr(C)]pub struct Geometry {
pub origin: Point,
pub size: Size,
}Expand description
Represents the location and size of a view
Fields§
§origin: PointThe location of the object
size: SizeThe size of the object
Implementations§
Source§impl Geometry
impl Geometry
Sourcepub fn new(origin: Point, size: Size) -> Geometry
pub fn new(origin: Point, size: Size) -> Geometry
Creates a new geometry with the given size and location.
Sourcepub fn contains_point(self, point: Point) -> bool
pub fn contains_point(self, point: Point) -> bool
Determines if this geometry contains a point.
If the point’s coordinates are less than or equal to this geometry’s dimensions plus its size.
Sourcepub fn contains_geometry(self, other: Geometry) -> bool
pub fn contains_geometry(self, other: Geometry) -> bool
Determines if this geometry contains another.
If the other geometry’s borders could be fully contained (less than or equal to) within self.
Trait Implementations§
impl Copy for Geometry
impl Eq for Geometry
impl StructuralPartialEq for Geometry
Auto Trait Implementations§
impl Freeze for Geometry
impl RefUnwindSafe for Geometry
impl Send for Geometry
impl Sync for Geometry
impl Unpin for Geometry
impl UnwindSafe for Geometry
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