Struct i_slint_core::api::LogicalPosition
source · [−]Expand description
A position represented in the coordinate space of logical pixels. That is the space before applying a display device specific scale factor.
Fields
x: f32The x coordinate.
y: f32The y coordinate.
Implementations
sourceimpl LogicalPosition
impl LogicalPosition
sourcepub const fn new(x: f32, y: f32) -> Self
pub const fn new(x: f32, y: f32) -> Self
Construct a new logical position from the given x and y coordinates, that are assumed to be in the logical coordinate space.
sourcepub fn from_physical(physical_pos: PhysicalPosition, scale_factor: f32) -> Self
pub fn from_physical(physical_pos: PhysicalPosition, scale_factor: f32) -> Self
Convert a given physical position to a logical position by dividing the coordinates with the specified scale factor.
sourcepub fn to_physical(&self, scale_factor: f32) -> PhysicalPosition
pub fn to_physical(&self, scale_factor: f32) -> PhysicalPosition
Convert this logical position to a physical position by multiplying the coordinates with the specified scale factor.
Trait Implementations
sourceimpl Clone for LogicalPosition
impl Clone for LogicalPosition
sourcefn clone(&self) -> LogicalPosition
fn clone(&self) -> LogicalPosition
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 LogicalPosition
impl Debug for LogicalPosition
sourceimpl Default for LogicalPosition
impl Default for LogicalPosition
sourcefn default() -> LogicalPosition
fn default() -> LogicalPosition
Returns the “default value” for a type. Read more
sourceimpl From<LogicalPosition> for WindowPosition
impl From<LogicalPosition> for WindowPosition
sourcefn from(original: LogicalPosition) -> WindowPosition
fn from(original: LogicalPosition) -> WindowPosition
Converts to this type from the input type.
sourceimpl PartialEq<LogicalPosition> for LogicalPosition
impl PartialEq<LogicalPosition> for LogicalPosition
sourcefn eq(&self, other: &LogicalPosition) -> bool
fn eq(&self, other: &LogicalPosition) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
impl Copy for LogicalPosition
impl StructuralPartialEq for LogicalPosition
Auto Trait Implementations
impl RefUnwindSafe for LogicalPosition
impl Send for LogicalPosition
impl Sync for LogicalPosition
impl Unpin for LogicalPosition
impl UnwindSafe for LogicalPosition
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.