Struct slint_interpreter::LogicalPosition
[−]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: f32
The x coordinate.
y: f32
The y coordinate.
Implementations
impl LogicalPosition
impl LogicalPosition
pub const fn new(x: f32, y: f32) -> LogicalPosition
pub const fn new(x: f32, y: f32) -> LogicalPosition
Construct a new logical position from the given x and y coordinates, that are assumed to be in the logical coordinate space.
pub fn from_physical(
physical_pos: PhysicalPosition,
scale_factor: f32
) -> LogicalPosition
pub fn from_physical(
physical_pos: PhysicalPosition,
scale_factor: f32
) -> LogicalPosition
Convert a given physical position to a logical position by dividing the coordinates with the specified scale factor.
pub 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
impl Clone for LogicalPosition
impl Clone for LogicalPosition
fn 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
impl Debug for LogicalPosition
impl Debug for LogicalPosition
impl Default for LogicalPosition
impl Default for LogicalPosition
fn default() -> LogicalPosition
fn default() -> LogicalPosition
Returns the “default value” for a type. Read more
impl From<LogicalPosition> for WindowPosition
impl From<LogicalPosition> for WindowPosition
fn from(original: LogicalPosition) -> WindowPosition
fn from(original: LogicalPosition) -> WindowPosition
Converts to this type from the input type.
impl PartialEq<LogicalPosition> for LogicalPosition
impl PartialEq<LogicalPosition> for LogicalPosition
fn 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> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> IsDefault for Twhere
T: Default + PartialEq<T> + Copy,
impl<T> IsDefault for Twhere
T: Default + PartialEq<T> + Copy,
fn is_default(&self) -> bool
fn is_default(&self) -> bool
Checks that type has a default value.
impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
fn null_value() -> T
fn null_value() -> T
The none-equivalent value.
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<R, P> ReadPrimitive<R> for Pwhere
R: Read + ReadEndian<P>,
P: Default,
impl<R, P> ReadPrimitive<R> for Pwhere
R: Read + ReadEndian<P>,
P: Default,
sourcefn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian()
.
sourcefn read_from_big_endian(read: &mut R) -> Result<Self, Error>
fn read_from_big_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian()
.
sourcefn read_from_native_endian(read: &mut R) -> Result<Self, Error>
fn read_from_native_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian()
.
impl<V, T> VZip<V> for Twhere
V: MultiLane<T>,
impl<V, T> VZip<V> for Twhere
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more