Struct glutin::dpi::PhysicalSize
source · pub struct PhysicalSize {
pub width: f64,
pub height: f64,
}
Expand description
A size represented in physical pixels.
The size 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<(u32, u32)>
implementation is provided which
does the rounding for you.
Fields§
§width: f64
§height: f64
Implementations§
source§impl PhysicalSize
impl PhysicalSize
pub fn new(width: f64, height: f64) -> PhysicalSize
pub fn from_logical<T>(logical: T, dpi_factor: f64) -> PhysicalSizewhere T: Into<LogicalSize>,
pub fn to_logical(&self, dpi_factor: f64) -> LogicalSize
Trait Implementations§
source§impl Clone for PhysicalSize
impl Clone for PhysicalSize
source§fn clone(&self) -> PhysicalSize
fn clone(&self) -> PhysicalSize
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 PhysicalSize
impl Debug for PhysicalSize
source§impl<'de> Deserialize<'de> for PhysicalSize
impl<'de> Deserialize<'de> for PhysicalSize
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<PhysicalSize, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<PhysicalSize, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq<PhysicalSize> for PhysicalSize
impl PartialEq<PhysicalSize> for PhysicalSize
source§fn eq(&self, other: &PhysicalSize) -> bool
fn eq(&self, other: &PhysicalSize) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for PhysicalSize
impl Serialize for PhysicalSize
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for PhysicalSize
impl StructuralPartialEq for PhysicalSize
Auto Trait Implementations§
impl RefUnwindSafe for PhysicalSize
impl Send for PhysicalSize
impl Sync for PhysicalSize
impl Unpin for PhysicalSize
impl UnwindSafe for PhysicalSize
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