Struct winit::dpi::LogicalSize
source · Expand description
A size represented in logical 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 LogicalSize
impl LogicalSize
pub fn new(width: f64, height: f64) -> Self
pub fn from_physical<T: Into<PhysicalSize>>(physical: T, dpi_factor: f64) -> Self
pub fn to_physical(&self, dpi_factor: f64) -> PhysicalSize
Trait Implementations
sourceimpl Clone for LogicalSize
impl Clone for LogicalSize
sourcefn clone(&self) -> LogicalSize
fn clone(&self) -> LogicalSize
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 LogicalSize
impl Debug for LogicalSize
sourceimpl<'de> Deserialize<'de> for LogicalSize
impl<'de> Deserialize<'de> for LogicalSize
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 LogicalSize
impl From<(f64, f64)> for LogicalSize
sourceimpl From<(u32, u32)> for LogicalSize
impl From<(u32, u32)> for LogicalSize
sourceimpl Into<(f64, f64)> for LogicalSize
impl Into<(f64, f64)> for LogicalSize
sourceimpl Into<(u32, u32)> for LogicalSize
impl Into<(u32, u32)> for LogicalSize
sourceimpl PartialEq<LogicalSize> for LogicalSize
impl PartialEq<LogicalSize> for LogicalSize
sourcefn eq(&self, other: &LogicalSize) -> bool
fn eq(&self, other: &LogicalSize) -> bool
sourceimpl Serialize for LogicalSize
impl Serialize for LogicalSize
impl Copy for LogicalSize
impl StructuralPartialEq for LogicalSize
Auto Trait Implementations
impl RefUnwindSafe for LogicalSize
impl Send for LogicalSize
impl Sync for LogicalSize
impl Unpin for LogicalSize
impl UnwindSafe for LogicalSize
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
.