Struct winit::dpi::LogicalPosition [−][src]
pub struct LogicalPosition<P> { pub x: P, pub y: P, }
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
impl<P> LogicalPosition<P>
[src]
impl<P: Pixel> LogicalPosition<P>
[src]
pub fn from_physical<T: Into<PhysicalPosition<X>>, X: Pixel>(
physical: T,
scale_factor: f64
) -> Self
[src]
physical: T,
scale_factor: f64
) -> Self
pub fn to_physical<X: Pixel>(&self, scale_factor: f64) -> PhysicalPosition<X>
[src]
pub fn cast<X: Pixel>(&self) -> LogicalPosition<X>
[src]
Trait Implementations
impl<P: Clone> Clone for LogicalPosition<P>
[src]
fn clone(&self) -> LogicalPosition<P>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<P: Copy> Copy for LogicalPosition<P>
[src]
impl<P: Debug> Debug for LogicalPosition<P>
[src]
impl<P: Pixel, X: Pixel> From<[X; 2]> for LogicalPosition<P>
[src]
fn from([x, y]: [X; 2]) -> LogicalPosition<P>
[src]
impl<P: Pixel, X: Pixel> From<(X, X)> for LogicalPosition<P>
[src]
fn from((x, y): (X, X)) -> LogicalPosition<P>
[src]
impl<P: Pixel> From<LogicalPosition<P>> for Position
[src]
fn from(position: LogicalPosition<P>) -> Position
[src]
impl<P: Pixel, X: Pixel> Into<[X; 2]> for LogicalPosition<P>
[src]
impl<P: Pixel, X: Pixel> Into<(X, X)> for LogicalPosition<P>
[src]
impl<P: PartialEq> PartialEq<LogicalPosition<P>> for LogicalPosition<P>
[src]
fn eq(&self, other: &LogicalPosition<P>) -> bool
[src]
fn ne(&self, other: &LogicalPosition<P>) -> bool
[src]
impl<P> StructuralPartialEq for LogicalPosition<P>
[src]
Auto Trait Implementations
impl<P> RefUnwindSafe for LogicalPosition<P> where
P: RefUnwindSafe,
P: RefUnwindSafe,
impl<P> Send for LogicalPosition<P> where
P: Send,
P: Send,
impl<P> Sync for LogicalPosition<P> where
P: Sync,
P: Sync,
impl<P> Unpin for LogicalPosition<P> where
P: Unpin,
P: Unpin,
impl<P> UnwindSafe for LogicalPosition<P> where
P: UnwindSafe,
P: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,