Struct i_slint_core::api::LogicalSize
source · [−]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
sourceimpl 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
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 more
sourceimpl Debug for LogicalSize
impl Debug for LogicalSize
sourceimpl Default for LogicalSize
impl Default for LogicalSize
sourcefn default() -> LogicalSize
fn default() -> LogicalSize
Returns the “default value” for a type. Read more
sourceimpl From<LogicalSize> for WindowSize
impl From<LogicalSize> for WindowSize
sourcefn from(original: LogicalSize) -> WindowSize
fn from(original: LogicalSize) -> WindowSize
Converts to this type from the input type.
sourceimpl PartialEq<LogicalSize> for LogicalSize
impl PartialEq<LogicalSize> for LogicalSize
sourcefn 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 ==. Read more
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
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.