pub struct Styled<Geometry> { /* private fields */ }Expand description
geometry with optional fill/stroke paint and an explicit fill rule.
Fill is drawn before stroke; Node opacity applies once to their combined result. Bounds conservatively include the stroke, not just its centerline.
Implementations§
Source§impl<Geometry: Shape> Styled<Geometry>
impl<Geometry: Shape> Styled<Geometry>
Sourcepub fn trim(self, start: f64, end: f64) -> Self
pub fn trim(self, start: f64, end: f64) -> Self
Clips source geometry by normalized arc distance before dashing. Bounds remain conservative and stable during growth animation.
Sourcepub fn dash(self, pattern: &[f64], offset: f64) -> Self
pub fn dash(self, pattern: &[f64], offset: f64) -> Self
Replaces the dash pattern/phase. Invalid or more than 256 entries fail during drawing, even on hidden or zero-width artwork.
Sourcepub fn fill(self, paint: impl Into<Paint>) -> Self
pub fn fill(self, paint: impl Into<Paint>) -> Self
Replaces the floating fill paint without changing geometry or rule.
Sourcepub fn stroke(self, width: f64, paint: impl Into<Paint>) -> Self
pub fn stroke(self, width: f64, paint: impl Into<Paint>) -> Self
Adds or replaces stroke paint/width, retaining cap and join selection.
Sourcepub fn stroke_style(self, style: StrokeStyle) -> Self
pub fn stroke_style(self, style: StrokeStyle) -> Self
Replaces stroke geometry style without enabling a missing stroke paint.
Sourcepub fn fill_rule(self, rule: FillRule) -> Self
pub fn fill_rule(self, rule: FillRule) -> Self
Replaces the contour rule; the default is FillRule::default.
Trait Implementations§
Source§impl<Geometry: Shape> Drawable for Styled<Geometry>
impl<Geometry: Shape> Drawable for Styled<Geometry>
Source§fn bounds(&self, _: &DrawContext) -> Result<Rect, ValidationError>
fn bounds(&self, _: &DrawContext) -> Result<Rect, ValidationError>
Local layout/ink bounds before node placement; invalid content is an error.
Source§fn draw(
&self,
_: &DrawContext,
canvas: &mut Canvas<'_>,
) -> Result<(), ValidationError>
fn draw( &self, _: &DrawContext, canvas: &mut Canvas<'_>, ) -> Result<(), ValidationError>
Emits local commands; validation errors propagate without partial output.
Auto Trait Implementations§
impl<Geometry> !RefUnwindSafe for Styled<Geometry>
impl<Geometry> !UnwindSafe for Styled<Geometry>
impl<Geometry> Forget for Styled<Geometry>
impl<Geometry> Freeze for Styled<Geometry>where
Geometry: Freeze,
impl<Geometry> Move for Styled<Geometry>
impl<Geometry> Send for Styled<Geometry>where
Geometry: Send,
impl<Geometry> Sync for Styled<Geometry>where
Geometry: Sync,
impl<Geometry> Unpin for Styled<Geometry>where
Geometry: Unpin,
impl<Geometry> UnsafeUnpin for Styled<Geometry>where
Geometry: UnsafeUnpin,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Output> IntoSceneOutput for Output
impl<Output> IntoSceneOutput for Output
Source§impl<Value> NodeModifiers for Value
impl<Value> NodeModifiers for Value
Source§fn layered_shadow(self, color: Color, radius: f64, offset: Vector2) -> Node
fn layered_shadow(self, color: Color, radius: f64, offset: Vector2) -> Node
Layers three soft silhouettes behind a single untouched source snapshot.
Source§fn elevated(self, elevation: Elevation) -> Node
fn elevated(self, elevation: Elevation) -> Node
Layers contact, key and ambient soft shadows that scale with an
Elevation.Source§fn gate_weave(self, seed: u64, frame: u64, amount: f64) -> Node
fn gate_weave(self, seed: u64, frame: u64, amount: f64) -> Node
Repeatable physical gate drift, keyed only by an explicit frame and seed.
Source§fn next_to(self, reference: &Node, side: Side, gap: f64) -> Node
fn next_to(self, reference: &Node, side: Side, gap: f64) -> Node
Places content next to the reference during compile-time layout.
Source§fn align_to(self, reference: &Node, edge: Side) -> Node
fn align_to(self, reference: &Node, edge: Side) -> Node
Aligns an edge with a compile-time measured reference snapshot.
Source§fn at(self, position: impl Into<Point>) -> Node
fn at(self, position: impl Into<Point>) -> Node
Places the selected pivot at a parent-space point, before translation.
Source§fn translate(self, horizontal: f64, vertical: f64) -> Node
fn translate(self, horizontal: f64, vertical: f64) -> Node
Adds parent-space translation, after scale and rotation.
Source§fn rotate(self, radians: f64) -> Node
fn rotate(self, radians: f64) -> Node
Adds clockwise radians about the pivot, after scale and before translation.
Source§fn scale(self, factor: f64) -> Node
fn scale(self, factor: f64) -> Node
Multiplies both scale factors; negative factors reflect and zero collapses.
Source§fn scale_xy(self, horizontal: f64, vertical: f64) -> Node
fn scale_xy(self, horizontal: f64, vertical: f64) -> Node
Multiplies per-axis scale factors about the pivot.
Source§fn pivot(self, pivot: Pivot) -> Node
fn pivot(self, pivot: Pivot) -> Node
Replaces the local-space pivot; defaults to the layout-bounds center.
Source§fn opacity(self, opacity: f64) -> Node
fn opacity(self, opacity: f64) -> Node
Replaces subtree opacity; invalid values are reported during conversion.
Source§fn blend_mode(self, mode: BlendMode) -> Node
fn blend_mode(self, mode: BlendMode) -> Node
Blends the completed subtree once against its immediate parent backdrop. Read more
Source§fn filter(self, filter: Filter) -> Node
fn filter(self, filter: Filter) -> Node
Appends a source-only filter, preserving declaration order. Read more
Source§fn clip(self, shape: impl IntoShapeClip) -> Node
fn clip(self, shape: impl IntoShapeClip) -> Node
Replaces the subtree’s local path-coverage clip without changing layout. Read more
Source§fn clip_with(self, shape: impl IntoShapeClip, mode: ClipMode) -> Node
fn clip_with(self, shape: impl IntoShapeClip, mode: ClipMode) -> Node
Clips with explicit coverage multiplication or geometric intersection.
Source§fn mask(self, mask: impl Into<Node>, mode: MaskMode) -> Node
fn mask(self, mask: impl Into<Node>, mode: MaskMode) -> Node
Replaces the local geometric rectangle clip without changing layout. Read more
Source§fn z_index(self, index: i32) -> Node
fn z_index(self, index: i32) -> Node
Replaces sibling-local stacking order; ties retain insertion order.