pub struct DrawGeometry {
pub local_size: PxSize,
pub local_to_window: LocalToWindow,
}Expand description
Local drawing dimensions and their precise placement in the render target.
Fields§
§local_size: PxSizeUnscaled dimensions used by command coordinates, radii and strokes.
local_to_window: LocalToWindowMapping from command-local pixels to render-target pixels.
Implementations§
Source§impl DrawGeometry
impl DrawGeometry
Sourcepub const fn new(local_size: PxSize, local_to_window: LocalToWindow) -> Self
pub const fn new(local_size: PxSize, local_to_window: LocalToWindow) -> Self
Creates drawing geometry with an explicit local-to-target mapping.
Sourcepub fn from_position_size(position: PxPosition, local_size: PxSize) -> Self
pub fn from_position_size(position: PxPosition, local_size: PxSize) -> Self
Creates unscaled geometry at a target position.
Sourcepub fn window_origin(self) -> PxPosition
pub fn window_origin(self) -> PxPosition
Returns the precise target origin.
Sourcepub fn window_size(self) -> [f32; 2]
pub fn window_size(self) -> [f32; 2]
Returns target dimensions without integer rounding.
Sourcepub fn window_bounds(self) -> FloatRect
pub fn window_bounds(self) -> FloatRect
Returns precise target bounds.
Sourcepub fn padded_window_bounds(self, padding: PaddingRect) -> FloatRect
pub fn padded_window_bounds(self, padding: PaddingRect) -> FloatRect
Maps local padding to target bounds without rounding individual edges.
Trait Implementations§
Source§impl Clone for DrawGeometry
impl Clone for DrawGeometry
Source§fn clone(&self) -> DrawGeometry
fn clone(&self) -> DrawGeometry
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 DrawGeometry
Source§impl Debug for DrawGeometry
impl Debug for DrawGeometry
Source§impl PartialEq for DrawGeometry
impl PartialEq for DrawGeometry
impl StructuralPartialEq for DrawGeometry
Auto Trait Implementations§
impl Freeze for DrawGeometry
impl RefUnwindSafe for DrawGeometry
impl Send for DrawGeometry
impl Sync for DrawGeometry
impl Unpin for DrawGeometry
impl UnsafeUnpin for DrawGeometry
impl UnwindSafe for DrawGeometry
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.