Struct i_slint_core::api::PhysicalSize
source · [−]Expand description
A size represented in the coordinate space of physical device pixels. That is the space after applying a display device specific scale factor to pixels from the logical coordinate space.
Fields
width: u32The width in physical pixels.
height: u32The height in physical pixels;
Implementations
sourceimpl PhysicalSize
impl PhysicalSize
sourcepub const fn new(width: u32, height: u32) -> Self
pub const fn new(width: u32, height: u32) -> Self
Construct a new physical size from the width and height values, that are assumed to be in the physical coordinate space.
sourcepub fn from_logical(logical_size: LogicalSize, scale_factor: f32) -> Self
pub fn from_logical(logical_size: LogicalSize, scale_factor: f32) -> Self
Convert a given logical size to a physical size by multiplying width and height with the specified scale factor.
sourcepub fn to_logical(&self, scale_factor: f32) -> LogicalSize
pub fn to_logical(&self, scale_factor: f32) -> LogicalSize
Convert this physical size to a logical size by dividing width and height by the specified scale factor.
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 more
sourceimpl Debug for PhysicalSize
impl Debug for PhysicalSize
sourceimpl Default for PhysicalSize
impl Default for PhysicalSize
sourcefn default() -> PhysicalSize
fn default() -> PhysicalSize
Returns the “default value” for a type. Read more
sourceimpl From<PhysicalSize> for WindowSize
impl From<PhysicalSize> for WindowSize
sourcefn from(original: PhysicalSize) -> WindowSize
fn from(original: PhysicalSize) -> WindowSize
Converts to this type from the input type.
sourceimpl PartialEq<PhysicalSize> for PhysicalSize
impl PartialEq<PhysicalSize> for PhysicalSize
sourcefn 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 ==. Read more
impl Copy for PhysicalSize
impl Eq for PhysicalSize
impl StructuralEq 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
sourceimpl<T> IsDefault for Twhere
T: Default + PartialEq<T> + Copy,
impl<T> IsDefault for Twhere
T: Default + PartialEq<T> + Copy,
sourcefn is_default(&self) -> bool
fn is_default(&self) -> bool
Checks that type has a default value.