pub struct PhysicalPoint {
pub x: f64,
pub y: f64,
}Expand description
A point in device pixels, relative to a window’s top-left corner.
f64 because pointer positions are sub-pixel: Wayland delivers them as
24.8 fixed point and a 240 Hz mouse on a scaled output genuinely moves less
than a pixel per event. Truncating here would quantize aim.
Fields§
§x: f64Distance from the left edge, in device pixels.
y: f64Distance from the top edge, in device pixels.
Implementations§
Source§impl PhysicalPoint
impl PhysicalPoint
Sourcepub fn to_logical(self, scale_factor: f64) -> LogicalPoint
pub fn to_logical(self, scale_factor: f64) -> LogicalPoint
This point in logical units at scale_factor.
Sourcepub fn is_inside(self, size: PhysicalSize) -> bool
pub fn is_inside(self, size: PhysicalSize) -> bool
Whether the point lies inside a window of size.
Trait Implementations§
Source§impl Clone for PhysicalPoint
impl Clone for PhysicalPoint
impl Copy for PhysicalPoint
Source§impl Debug for PhysicalPoint
impl Debug for PhysicalPoint
Source§impl Default for PhysicalPoint
impl Default for PhysicalPoint
Source§impl PartialEq for PhysicalPoint
impl PartialEq for PhysicalPoint
impl StructuralPartialEq for PhysicalPoint
Auto Trait Implementations§
impl Freeze for PhysicalPoint
impl RefUnwindSafe for PhysicalPoint
impl Send for PhysicalPoint
impl Sync for PhysicalPoint
impl Unpin for PhysicalPoint
impl UnsafeUnpin for PhysicalPoint
impl UnwindSafe for PhysicalPoint
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