Struct i_slint_core::api::PhysicalSize
source · pub struct PhysicalSize {
pub width: u32,
pub height: u32,
}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§
source§impl 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§
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 Default for PhysicalSize
impl Default for PhysicalSize
source§fn default() -> PhysicalSize
fn default() -> PhysicalSize
Returns the “default value” for a type. Read more
source§impl From<PhysicalSize> for WindowSize
impl From<PhysicalSize> for WindowSize
source§fn from(original: PhysicalSize) -> WindowSize
fn from(original: PhysicalSize) -> WindowSize
Converts to this type from the input type.
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 ==.