Struct winit::dpi::PhysicalPosition [−][src]
A position represented in physical 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: f64
y: f64
Methods
impl PhysicalPosition[src]
impl PhysicalPositionpub fn new(x: f64, y: f64) -> Self[src]
pub fn new(x: f64, y: f64) -> Selfpub fn from_logical<T: Into<LogicalPosition>>(
logical: T,
dpi_factor: f64
) -> Self[src]
pub fn from_logical<T: Into<LogicalPosition>>(
logical: T,
dpi_factor: f64
) -> Selfpub fn to_logical(&self, dpi_factor: f64) -> LogicalPosition[src]
pub fn to_logical(&self, dpi_factor: f64) -> LogicalPositionTrait Implementations
impl Debug for PhysicalPosition[src]
impl Debug for PhysicalPositionfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Copy for PhysicalPosition[src]
impl Copy for PhysicalPositionimpl Clone for PhysicalPosition[src]
impl Clone for PhysicalPositionfn clone(&self) -> PhysicalPosition[src]
fn clone(&self) -> PhysicalPositionReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0
[src]Performs copy-assignment from source. Read more
impl PartialEq for PhysicalPosition[src]
impl PartialEq for PhysicalPositionfn eq(&self, other: &PhysicalPosition) -> bool[src]
fn eq(&self, other: &PhysicalPosition) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &PhysicalPosition) -> bool[src]
fn ne(&self, other: &PhysicalPosition) -> boolThis method tests for !=.
impl From<(f64, f64)> for PhysicalPosition[src]
impl From<(f64, f64)> for PhysicalPositionimpl From<(i32, i32)> for PhysicalPosition[src]
impl From<(i32, i32)> for PhysicalPositionimpl Into<(f64, f64)> for PhysicalPosition[src]
impl Into<(f64, f64)> for PhysicalPositionimpl Into<(i32, i32)> for PhysicalPosition[src]
impl Into<(i32, i32)> for PhysicalPositionAuto Trait Implementations
impl Send for PhysicalPosition
impl Send for PhysicalPositionimpl Sync for PhysicalPosition
impl Sync for PhysicalPosition