pub struct Offset {
pub x: u16,
pub y: u16,
}Expand description
A position inside one window, counted from its top-left corner.
Not the same thing as a Pos, and kept apart for the same reason the two conventions a cell
carries are: a Pos is a point in the plane and may be negative, an Offset is a column and a
row within a rectangle and never is. Which one a method takes is the question it is asking —
a figure is placed at a Pos, a click arrives as an Offset — so the two are separate types
rather than one rectangle’s worth of interchangeable numbers.
Fields§
§x: u16Grows to the right, from the window’s own leftmost column.
y: u16Grows downward, from the window’s own topmost row.
Trait Implementations§
impl Copy for Offset
impl Eq for Offset
impl StructuralPartialEq for Offset
Auto Trait Implementations§
impl Forget for Offset
impl Freeze for Offset
impl RefUnwindSafe for Offset
impl Send for Offset
impl Sync for Offset
impl Unpin for Offset
impl UnsafeUnpin for Offset
impl UnwindSafe for Offset
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