Struct i_slint_core::api::LogicalSize
source · pub struct LogicalSize {
pub width: f32,
pub height: f32,
}Expand description
A size represented in the coordinate space of logical pixels. That is the space before applying a display device specific scale factor.
Fields§
§width: f32The width in logical pixels.
height: f32The height in logical.
Implementations§
source§impl LogicalSize
impl LogicalSize
sourcepub const fn new(width: f32, height: f32) -> Self
pub const fn new(width: f32, height: f32) -> Self
Construct a new logical size from the given width and height values, that are assumed to be in the logical coordinate space.
sourcepub fn from_physical(physical_size: PhysicalSize, scale_factor: f32) -> Self
pub fn from_physical(physical_size: PhysicalSize, scale_factor: f32) -> Self
Convert a given physical size to a logical size by dividing width and height by the specified scale factor.
sourcepub fn to_physical(&self, scale_factor: f32) -> PhysicalSize
pub fn to_physical(&self, scale_factor: f32) -> PhysicalSize
Convert this logical size to a physical size by multiplying width and height with the specified scale factor.
Trait Implementations§
source§impl Clone for LogicalSize
impl Clone for LogicalSize
source§fn clone(&self) -> LogicalSize
fn clone(&self) -> LogicalSize
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 LogicalSize
impl Debug for LogicalSize
source§impl Default for LogicalSize
impl Default for LogicalSize
source§fn default() -> LogicalSize
fn default() -> LogicalSize
Returns the “default value” for a type. Read more
source§impl From<LogicalSize> for WindowSize
impl From<LogicalSize> for WindowSize
source§fn from(original: LogicalSize) -> WindowSize
fn from(original: LogicalSize) -> WindowSize
Converts to this type from the input type.
source§impl PartialEq<LogicalSize> for LogicalSize
impl PartialEq<LogicalSize> for LogicalSize
source§fn eq(&self, other: &LogicalSize) -> bool
fn eq(&self, other: &LogicalSize) -> bool
This method tests for
self and other values to be equal, and is used
by ==.