pub struct ScreenRect {
pub min: ScreenPoint,
pub max: ScreenPoint,
}Expand description
A rectangle in screen coordinates.
Fields§
§min: ScreenPointThe top-left corner.
max: ScreenPointThe bottom-right corner.
Implementations§
Source§impl ScreenRect
impl ScreenRect
Sourcepub fn from_min_max(a: ScreenPoint, b: ScreenPoint) -> Self
pub fn from_min_max(a: ScreenPoint, b: ScreenPoint) -> Self
A rectangle from two opposite corners in any order.
Sourcepub fn from_min_size(min: ScreenPoint, width: f32, height: f32) -> Self
pub fn from_min_size(min: ScreenPoint, width: f32, height: f32) -> Self
A rectangle from its top-left corner and size.
Sourcepub fn is_positive(self) -> bool
pub fn is_positive(self) -> bool
Whether the rectangle has a positive area.
Sourcepub fn contains(self, point: ScreenPoint) -> bool
pub fn contains(self, point: ScreenPoint) -> bool
Whether point lies inside the rectangle (edges included).
Trait Implementations§
Source§impl Clone for ScreenRect
impl Clone for ScreenRect
impl Copy for ScreenRect
Source§impl Debug for ScreenRect
impl Debug for ScreenRect
Source§impl Default for ScreenRect
impl Default for ScreenRect
Source§impl PartialEq for ScreenRect
impl PartialEq for ScreenRect
impl StructuralPartialEq for ScreenRect
Auto Trait Implementations§
impl Forget for ScreenRect
impl Freeze for ScreenRect
impl Move for ScreenRect
impl RefUnwindSafe for ScreenRect
impl Send for ScreenRect
impl Sync for ScreenRect
impl Unpin for ScreenRect
impl UnsafeUnpin for ScreenRect
impl UnwindSafe for ScreenRect
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