#[repr(C)]pub struct LogicalRect {
pub origin: LogicalPosition,
pub size: LogicalSize,
}Fields§
§origin: LogicalPosition§size: LogicalSizeImplementations§
Source§impl LogicalRect
impl LogicalRect
pub const fn zero() -> Self
pub const fn new(origin: LogicalPosition, size: LogicalSize) -> Self
pub fn scale_for_dpi(&mut self, scale_factor: f32)
pub fn max_x(&self) -> f32
pub fn min_x(&self) -> f32
pub fn max_y(&self) -> f32
pub fn min_y(&self) -> f32
Sourcepub fn hit_test(&self, other: &LogicalPosition) -> Option<LogicalPosition>
pub fn hit_test(&self, other: &LogicalPosition) -> Option<LogicalPosition>
Same as contains(), but returns the (x, y) offset of the hit point
On a regular computer this function takes ~3.2ns to run
pub fn to_layout_rect(&self) -> LayoutRect
Trait Implementations§
Source§impl Clone for LogicalRect
impl Clone for LogicalRect
Source§fn clone(&self) -> LogicalRect
fn clone(&self) -> LogicalRect
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LogicalRect
impl Debug for LogicalRect
Source§impl Display for LogicalRect
impl Display for LogicalRect
Source§impl FromIterator<LogicalRect> for LogicalRectVec
impl FromIterator<LogicalRect> for LogicalRectVec
Source§fn from_iter<T>(iter: T) -> Selfwhere
T: IntoIterator<Item = LogicalRect>,
fn from_iter<T>(iter: T) -> Selfwhere
T: IntoIterator<Item = LogicalRect>,
Creates a value from an iterator. Read more
Source§impl Hash for LogicalRect
impl Hash for LogicalRect
Source§impl Ord for LogicalRect
impl Ord for LogicalRect
Source§fn cmp(&self, other: &LogicalRect) -> Ordering
fn cmp(&self, other: &LogicalRect) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for LogicalRect
impl PartialEq for LogicalRect
Source§impl PartialOrd for LogicalRect
impl PartialOrd for LogicalRect
impl Copy for LogicalRect
impl Eq for LogicalRect
impl StructuralPartialEq for LogicalRect
Auto Trait Implementations§
impl Freeze for LogicalRect
impl RefUnwindSafe for LogicalRect
impl Send for LogicalRect
impl Sync for LogicalRect
impl Unpin for LogicalRect
impl UnwindSafe for LogicalRect
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more