pub struct Canvas { /* private fields */ }
Expand description
A canvas that can be drawn on.
Implementations§
Source§impl Canvas
impl Canvas
Sourcepub fn primitives(&self) -> impl Iterator<Item = &Primitive>
pub fn primitives(&self) -> impl Iterator<Item = &Primitive>
Get the primitives of the canvas.
Sourcepub fn fill(
&mut self,
curve: impl Into<Arc<Curve>>,
fill: FillRule,
paint: impl Into<Paint>,
)
pub fn fill( &mut self, curve: impl Into<Arc<Curve>>, fill: FillRule, paint: impl Into<Paint>, )
Fill a curve.
Sourcepub fn stroke(
&mut self,
curve: impl Into<Arc<Curve>>,
stroke: impl Into<Stroke>,
paint: impl Into<Paint>,
)
pub fn stroke( &mut self, curve: impl Into<Arc<Curve>>, stroke: impl Into<Stroke>, paint: impl Into<Paint>, )
Stroke a curve.
Sourcepub fn draw_canvas(&mut self, canvas: Canvas)
pub fn draw_canvas(&mut self, canvas: Canvas)
Draw a canvas.
Sourcepub fn overlay<T>(&mut self, index: i32, f: impl FnOnce(&mut Canvas) -> T) -> T
pub fn overlay<T>(&mut self, index: i32, f: impl FnOnce(&mut Canvas) -> T) -> T
Draw an overlay.
Sourcepub fn layer<T>(
&mut self,
transform: Affine,
mask: Option<Mask>,
view: Option<ViewId>,
f: impl FnOnce(&mut Canvas) -> T,
) -> T
pub fn layer<T>( &mut self, transform: Affine, mask: Option<Mask>, view: Option<ViewId>, f: impl FnOnce(&mut Canvas) -> T, ) -> T
Draw a layer.
Sourcepub fn transformed<T>(
&mut self,
transform: Affine,
f: impl FnOnce(&mut Canvas) -> T,
) -> T
pub fn transformed<T>( &mut self, transform: Affine, f: impl FnOnce(&mut Canvas) -> T, ) -> T
Draw a layer with a transformation.
Sourcepub fn translated<T>(
&mut self,
translation: Vector,
f: impl FnOnce(&mut Canvas) -> T,
) -> T
pub fn translated<T>( &mut self, translation: Vector, f: impl FnOnce(&mut Canvas) -> T, ) -> T
Draw a layer with a translation.
Sourcepub fn rotated<T>(&mut self, angle: f32, f: impl FnOnce(&mut Canvas) -> T) -> T
pub fn rotated<T>(&mut self, angle: f32, f: impl FnOnce(&mut Canvas) -> T) -> T
Draw a layer with a rotation.
Sourcepub fn scaled<T>(
&mut self,
scale: Vector,
f: impl FnOnce(&mut Canvas) -> T,
) -> T
pub fn scaled<T>( &mut self, scale: Vector, f: impl FnOnce(&mut Canvas) -> T, ) -> T
Draw a layer with a scale.
Sourcepub fn masked<T>(&mut self, mask: Mask, f: impl FnOnce(&mut Canvas) -> T) -> T
pub fn masked<T>(&mut self, mask: Mask, f: impl FnOnce(&mut Canvas) -> T) -> T
Draw a layer with a mask.
Trait Implementations§
impl StructuralPartialEq for Canvas
Auto Trait Implementations§
impl Freeze for Canvas
impl RefUnwindSafe for Canvas
impl Send for Canvas
impl Sync for Canvas
impl Unpin for Canvas
impl UnwindSafe for Canvas
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