Struct glutin::dpi::LogicalPosition [−][src]
pub struct LogicalPosition<P> {
pub x: P,
pub y: P,
}
Expand description
A position represented in logical pixels.
The position is stored as floats, so please be careful. Casting floats to integers truncates the
fractional part, which can cause noticable issues. To help with that, an Into<(i32, i32)>
implementation is provided which does the rounding for you.
Fields
x: P
y: P
Implementations
pub fn from_physical<T, X>(physical: T, scale_factor: f64) -> LogicalPosition<P> where
T: Into<PhysicalPosition<X>>,
X: Pixel,
Trait Implementations
Returns the “default value” for a type. Read more
Performs the conversion.
Performs the conversion.
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl<P> RefUnwindSafe for LogicalPosition<P> where
P: RefUnwindSafe,
impl<P> Send for LogicalPosition<P> where
P: Send,
impl<P> Sync for LogicalPosition<P> where
P: Sync,
impl<P> Unpin for LogicalPosition<P> where
P: Unpin,
impl<P> UnwindSafe for LogicalPosition<P> where
P: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more