pub struct LocalToWindow { /* private fields */ }Expand description
A positive uniform scale followed by a translation in physical pixels.
Implementations§
Source§impl LocalToWindow
impl LocalToWindow
Sourcepub fn new(scale: f32, translation: PxPosition) -> Option<Self>
pub fn new(scale: f32, translation: PxPosition) -> Option<Self>
Creates a finite, invertible uniform coordinate transformation.
Sourcepub const fn translation(self) -> PxPosition
pub const fn translation(self) -> PxPosition
Returns the mapped local origin.
Sourcepub fn map_point(self, point: PxPosition) -> PxPosition
pub fn map_point(self, point: PxPosition) -> PxPosition
Maps a local point into window coordinates.
Sourcepub fn map_vector(self, vector: PxPosition) -> PxPosition
pub fn map_vector(self, vector: PxPosition) -> PxPosition
Maps a local displacement into window coordinates.
Sourcepub fn inverse_point(self, point: PxPosition) -> PxPosition
pub fn inverse_point(self, point: PxPosition) -> PxPosition
Maps a window point into local coordinates.
Sourcepub fn inverse_vector(self, vector: PxPosition) -> PxPosition
pub fn inverse_vector(self, vector: PxPosition) -> PxPosition
Maps a window displacement into local coordinates.
Sourcepub fn compose(self, child: Self) -> Option<Self>
pub fn compose(self, child: Self) -> Option<Self>
Composes a child transformation followed by this transformation.
Sourcepub fn with_local_origin(self, origin: PxPosition) -> Self
pub fn with_local_origin(self, origin: PxPosition) -> Self
Moves the local origin without changing the scale.
Sourcepub fn map_size(self, size: PxSize) -> [f32; 2]
pub fn map_size(self, size: PxSize) -> [f32; 2]
Maps an integer layout size into fractional window extents.
Sourcepub fn map_rect(self, rect: FloatRect) -> FloatRect
pub fn map_rect(self, rect: FloatRect) -> FloatRect
Maps a local rectangle into window coordinates.
Sourcepub fn inverse_rect(self, rect: FloatRect) -> FloatRect
pub fn inverse_rect(self, rect: FloatRect) -> FloatRect
Maps a window rectangle into local coordinates.
Trait Implementations§
Source§impl Clone for LocalToWindow
impl Clone for LocalToWindow
Source§fn clone(&self) -> LocalToWindow
fn clone(&self) -> LocalToWindow
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for LocalToWindow
Source§impl Debug for LocalToWindow
impl Debug for LocalToWindow
Source§impl Default for LocalToWindow
impl Default for LocalToWindow
Source§impl PartialEq for LocalToWindow
impl PartialEq for LocalToWindow
impl StructuralPartialEq for LocalToWindow
Auto Trait Implementations§
impl Freeze for LocalToWindow
impl RefUnwindSafe for LocalToWindow
impl Send for LocalToWindow
impl Sync for LocalToWindow
impl Unpin for LocalToWindow
impl UnsafeUnpin for LocalToWindow
impl UnwindSafe for LocalToWindow
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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.