#[repr(C)]pub struct PhysicalPosition<T> {
pub x: T,
pub y: T,
}Expand description
A 2D position in physical (pixel) coordinates.
Fields§
§x: T§y: TImplementations§
Source§impl<T> PhysicalPosition<T>
impl<T> PhysicalPosition<T>
Source§impl PhysicalPosition<i32>
impl PhysicalPosition<i32>
pub const fn zero() -> Self
Sourcepub fn to_logical(self, hidpi_factor: f32) -> LogicalPosition
pub fn to_logical(self, hidpi_factor: f32) -> LogicalPosition
Converts to logical coordinates by dividing by the DPI factor.
Source§impl PhysicalPosition<f64>
impl PhysicalPosition<f64>
pub const fn zero() -> Self
Sourcepub fn to_logical(self, hidpi_factor: f32) -> LogicalPosition
pub fn to_logical(self, hidpi_factor: f32) -> LogicalPosition
Converts to logical coordinates by dividing by the DPI factor.
Trait Implementations§
Source§impl<T: Clone> Clone for PhysicalPosition<T>
impl<T: Clone> Clone for PhysicalPosition<T>
Source§fn clone(&self) -> PhysicalPosition<T>
fn clone(&self) -> PhysicalPosition<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Display> Debug for PhysicalPosition<T>
impl<T: Display> Debug for PhysicalPosition<T>
Source§impl<T: Hash> Hash for PhysicalPosition<T>
impl<T: Hash> Hash for PhysicalPosition<T>
Source§impl<T: Ord> Ord for PhysicalPosition<T>
impl<T: Ord> Ord for PhysicalPosition<T>
Source§fn cmp(&self, other: &PhysicalPosition<T>) -> Ordering
fn cmp(&self, other: &PhysicalPosition<T>) -> Ordering
1.21.0 (const: unstable) · 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<T: PartialEq> PartialEq for PhysicalPosition<T>
impl<T: PartialEq> PartialEq for PhysicalPosition<T>
Source§fn eq(&self, other: &PhysicalPosition<T>) -> bool
fn eq(&self, other: &PhysicalPosition<T>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<T: PartialOrd> PartialOrd for PhysicalPosition<T>
impl<T: PartialOrd> PartialOrd for PhysicalPosition<T>
impl<T: Copy> Copy for PhysicalPosition<T>
impl<T: Eq> Eq for PhysicalPosition<T>
impl<T> StructuralPartialEq for PhysicalPosition<T>
Auto Trait Implementations§
impl<T> Freeze for PhysicalPosition<T>where
T: Freeze,
impl<T> RefUnwindSafe for PhysicalPosition<T>where
T: RefUnwindSafe,
impl<T> Send for PhysicalPosition<T>where
T: Send,
impl<T> Sync for PhysicalPosition<T>where
T: Sync,
impl<T> Unpin for PhysicalPosition<T>where
T: Unpin,
impl<T> UnsafeUnpin for PhysicalPosition<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for PhysicalPosition<T>where
T: UnwindSafe,
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