Struct winit::dpi::PhysicalSize
source · 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
sourceimpl PhysicalSize
impl PhysicalSize
pub fn new(width: f64, height: f64) -> Self
pub fn from_logical<T: Into<LogicalSize>>(logical: T, dpi_factor: f64) -> Self
pub fn to_logical(&self, dpi_factor: f64) -> LogicalSize
Trait Implementations
sourceimpl Clone for PhysicalSize
impl Clone for PhysicalSize
sourcefn clone(&self) -> PhysicalSize
fn clone(&self) -> PhysicalSize
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for PhysicalSize
impl Debug for PhysicalSize
sourceimpl<'de> Deserialize<'de> for PhysicalSize
impl<'de> Deserialize<'de> for PhysicalSize
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl From<(f64, f64)> for PhysicalSize
impl From<(f64, f64)> for PhysicalSize
sourceimpl From<(u32, u32)> for PhysicalSize
impl From<(u32, u32)> for PhysicalSize
sourceimpl Into<(f64, f64)> for PhysicalSize
impl Into<(f64, f64)> for PhysicalSize
sourceimpl Into<(u32, u32)> for PhysicalSize
impl Into<(u32, u32)> for PhysicalSize
sourceimpl PartialEq<PhysicalSize> for PhysicalSize
impl PartialEq<PhysicalSize> for PhysicalSize
sourcefn eq(&self, other: &PhysicalSize) -> bool
fn eq(&self, other: &PhysicalSize) -> bool
sourceimpl Serialize for PhysicalSize
impl Serialize for PhysicalSize
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Resultwhere
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Resultwhere
T: Parameter<Self>,
Sets
value
as a parameter of self
.