pub struct GridRect {
pub top_left: GridPoint,
pub size: GridSize,
}Expand description
Atomic wherever it appears — one register holds the whole rect.
Fields§
§top_left: GridPoint§size: GridSizeImplementations§
Source§impl GridRect
contains is closed on every edge while intersects is open on the
right and bottom — a point on a shared edge is inside both rects, yet
edge-adjacent rects do not overlap. Hit-testing rests on the
disagreement, so re-deriving either would move it.
impl GridRect
contains is closed on every edge while intersects is open on the
right and bottom — a point on a shared edge is inside both rects, yet
edge-adjacent rects do not overlap. Hit-testing rests on the
disagreement, so re-deriving either would move it.
pub fn from_two_pos(a: GridPoint, b: GridPoint) -> Self
pub fn max(self) -> GridPoint
pub fn left(self) -> i32
pub fn top(self) -> i32
pub fn right(self) -> i32
pub fn bottom(self) -> i32
pub fn contains(self, p: GridPoint) -> bool
pub fn intersects(self, other: GridRect) -> bool
Sourcepub fn intersection(self, other: GridRect) -> Option<Self>
pub fn intersection(self, other: GridRect) -> Option<Self>
The cells two rects share, or None where they share none. Open on
the right and the bottom, as Self::intersects is.
pub fn translate(self, delta: GridVec) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GridRect
impl<'de> Deserialize<'de> for GridRect
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 Copy for GridRect
impl Eq for GridRect
impl StructuralPartialEq for GridRect
Auto Trait Implementations§
impl Freeze for GridRect
impl RefUnwindSafe for GridRect
impl Send for GridRect
impl Sync for GridRect
impl Unpin for GridRect
impl UnsafeUnpin for GridRect
impl UnwindSafe for GridRect
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