pub struct Rectangle { /* private fields */ }Expand description
Achsenausgerichtetes Rechteck auf einem ganzzahligen Pixelraster.
Axis-aligned rectangle on an integer pixel grid.
Implementations§
Source§impl Rectangle
impl Rectangle
Sourcepub fn new(start: UVec2, end: UVec2) -> Self
pub fn new(start: UVec2, end: UVec2) -> Self
Erstellt ein Rechteck aus inklusive Start- und Endecke.
Creates a rectangle from inclusive start and end corners.
Sourcepub fn from_size(start: UVec2, size: UVec2) -> Self
pub fn from_size(start: UVec2, size: UVec2) -> Self
Erstellt ein Rechteck aus Startecke und Größe.
Creates a rectangle from a start corner and a size.
Sourcepub fn start(&self) -> UVec2
pub fn start(&self) -> UVec2
Gibt die inklusive Startecke zurück.
Returns the inclusive start corner.
Sourcepub fn end(&self) -> UVec2
pub fn end(&self) -> UVec2
Gibt die inklusive Endecke zurück.
Returns the inclusive end corner.
Sourcepub fn contains(&self, point: UVec2) -> bool
pub fn contains(&self, point: UVec2) -> bool
Gibt zurück, ob das Rechteck den Punkt enthält.
Returns whether the rectangle contains the given point.
Sourcepub fn intersects(&self, other: &Rectangle) -> bool
pub fn intersects(&self, other: &Rectangle) -> bool
Gibt zurück, ob sich dieses Rechteck mit einem anderen schneidet.
Returns whether this rectangle intersects another.
Trait Implementations§
impl Copy for Rectangle
Source§impl<'de> Deserialize<'de> for Rectangle
impl<'de> Deserialize<'de> for Rectangle
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Rectangle
impl StructuralPartialEq for Rectangle
Auto Trait Implementations§
impl Freeze for Rectangle
impl RefUnwindSafe for Rectangle
impl Send for Rectangle
impl Sync for Rectangle
impl Unpin for Rectangle
impl UnsafeUnpin for Rectangle
impl UnwindSafe for Rectangle
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