Enum canvas::canvas_data::PathState
source · enum PathState {
UserSpacePathBuilder(Box<dyn GenericPathBuilder>, Option<Transform2D<f32>>),
DeviceSpacePathBuilder(Box<dyn GenericPathBuilder>),
UserSpacePath(Path, Option<Transform2D<f32>>),
}
Expand description
The canvas data stores a state machine for the current status of the path data and any relevant transformations that are applied to it. The Azure drawing API expects the path to be in userspace. However, when a path is being built but the canvas’ transform changes, we choose to transform the path and perform further operations to it in device space. When it’s time to draw the path, we convert it back to userspace and draw it with the correct transform applied. TODO: De-abstract now that Azure is removed?
Variants§
UserSpacePathBuilder(Box<dyn GenericPathBuilder>, Option<Transform2D<f32>>)
Path builder in user-space. If a transform has been applied but no further path operations have occurred, it is stored in the optional field.
DeviceSpacePathBuilder(Box<dyn GenericPathBuilder>)
Path builder in device-space.
UserSpacePath(Path, Option<Transform2D<f32>>)
Path in user-space. If a transform has been applied but but no further path operations have occurred, it is stored in the optional field.
Implementations§
Auto Trait Implementations§
impl Freeze for PathState
impl !RefUnwindSafe for PathState
impl !Send for PathState
impl !Sync for PathState
impl Unpin for PathState
impl !UnwindSafe for PathState
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more