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 PhysicalPosition
pub fn new(x: f64, y: f64) -> Self
[src]
pub fn new(x: f64, y: f64) -> Self
pub 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
) -> Self
pub fn to_logical(&self, dpi_factor: f64) -> LogicalPosition
[src]
pub fn to_logical(&self, dpi_factor: f64) -> LogicalPosition
Trait Implementations
impl Debug for PhysicalPosition
[src]
impl Debug for PhysicalPosition
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Copy for PhysicalPosition
[src]
impl Copy for PhysicalPosition
impl Clone for PhysicalPosition
[src]
impl Clone for PhysicalPosition
fn clone(&self) -> PhysicalPosition
[src]
fn clone(&self) -> PhysicalPosition
Returns 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 PhysicalPosition
fn eq(&self, other: &PhysicalPosition) -> bool
[src]
fn eq(&self, other: &PhysicalPosition) -> bool
This 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) -> bool
This method tests for !=
.
impl From<(f64, f64)> for PhysicalPosition
[src]
impl From<(f64, f64)> for PhysicalPosition
impl From<(i32, i32)> for PhysicalPosition
[src]
impl From<(i32, i32)> for PhysicalPosition
impl Into<(f64, f64)> for PhysicalPosition
[src]
impl Into<(f64, f64)> for PhysicalPosition
impl Into<(i32, i32)> for PhysicalPosition
[src]
impl Into<(i32, i32)> for PhysicalPosition
Auto Trait Implementations
impl Send for PhysicalPosition
impl Send for PhysicalPosition
impl Sync for PhysicalPosition
impl Sync for PhysicalPosition