Struct glutin::dpi::PhysicalPosition
source · pub struct PhysicalPosition {
pub x: f64,
pub y: f64,
}
Expand description
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
Implementations§
source§impl PhysicalPosition
impl PhysicalPosition
pub fn new(x: f64, y: f64) -> PhysicalPosition
pub fn from_logical<T>(logical: T, dpi_factor: f64) -> PhysicalPositionwhere T: Into<LogicalPosition>,
pub fn to_logical(&self, dpi_factor: f64) -> LogicalPosition
Trait Implementations§
source§impl Clone for PhysicalPosition
impl Clone for PhysicalPosition
source§fn clone(&self) -> PhysicalPosition
fn clone(&self) -> PhysicalPosition
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for PhysicalPosition
impl Debug for PhysicalPosition
source§impl PartialEq<PhysicalPosition> for PhysicalPosition
impl PartialEq<PhysicalPosition> for PhysicalPosition
source§fn eq(&self, other: &PhysicalPosition) -> bool
fn eq(&self, other: &PhysicalPosition) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for PhysicalPosition
impl StructuralPartialEq for PhysicalPosition
Auto Trait Implementations§
impl RefUnwindSafe for PhysicalPosition
impl Send for PhysicalPosition
impl Sync for PhysicalPosition
impl Unpin for PhysicalPosition
impl UnwindSafe for PhysicalPosition
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.