pub struct Rect {
pub start: Point2<i16>,
pub end: Point2<i16>,
}
Expand description
A rectangular region of the display.
When drawn to the display, both the start and the end points are included inside
the drawn region. Thus, the area of the drawn rectangle is
(1 + end.x - start.x) * (1 + end.y - start.y)
pixels.
Fields§
§start: Point2<i16>
First point (coordinate) of the rectangle
end: Point2<i16>
Second point (coordinate) of the rectangle
Implementations§
Source§impl Rect
impl Rect
Sourcepub fn new(start: impl Into<Point2<i16>>, end: impl Into<Point2<i16>>) -> Self
pub fn new(start: impl Into<Point2<i16>>, end: impl Into<Point2<i16>>) -> Self
Create a new rectangle with the given coordinates.
Trait Implementations§
impl Copy for Rect
impl Eq 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 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