Skip to main content

ShapeExt

Trait ShapeExt 

Source
pub trait ShapeExt: Shape + Sized {
    // Provided methods
    fn fill(self, color: impl Into<Color>) -> FilledShape { ... }
    fn morph_to(
        self,
        target: impl ShapeExt,
        fill: impl Into<Color>,
    ) -> MorphShape { ... }
}
Expand description

Extension trait for filling shapes with color.

Provided Methods§

Source

fn fill(self, color: impl Into<Color>) -> FilledShape

Fills the shape with the specified color.

Source

fn morph_to(self, target: impl ShapeExt, fill: impl Into<Color>) -> MorphShape

Creates a morphing filled shape from this shape to another built-in shape.

Morphing currently supports SDF-backed built-in shapes: Rectangle, Circle, Ellipse, RoundedRectangle, UnevenRoundedRectangle, Capsule.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§