Trait nannou::draw::properties::stroke::SetStroke[][src]

pub trait SetStroke: Sized {
Show methods fn stroke_options_mut(&mut self) -> &mut StrokeOptions; fn stroke_opts(self, opts: StrokeOptions) -> Self { ... }
fn start_cap(self, cap: LineCap) -> Self { ... }
fn end_cap(self, cap: LineCap) -> Self { ... }
fn caps(self, cap: LineCap) -> Self { ... }
fn start_cap_butt(self) -> Self { ... }
fn start_cap_square(self) -> Self { ... }
fn start_cap_round(self) -> Self { ... }
fn end_cap_butt(self) -> Self { ... }
fn end_cap_square(self) -> Self { ... }
fn end_cap_round(self) -> Self { ... }
fn caps_butt(self) -> Self { ... }
fn caps_square(self) -> Self { ... }
fn caps_round(self) -> Self { ... }
fn join(self, join: LineJoin) -> Self { ... }
fn join_miter(self) -> Self { ... }
fn join_miter_clip(self) -> Self { ... }
fn join_round(self) -> Self { ... }
fn join_bevel(self) -> Self { ... }
fn stroke_weight(self, stroke_weight: f32) -> Self { ... }
fn miter_limit(self, limit: f32) -> Self { ... }
fn stroke_tolerance(self, tolerance: f32) -> Self { ... }
}

Nodes that support stroke tessellation.

This trait allows the Drawing context to automatically provide an implementation of the following builder methods for all primitives that provide some stroke tessellation options.

Required methods

fn stroke_options_mut(&mut self) -> &mut StrokeOptions[src]

Provide a mutable reference to the StrokeOptions field.

Loading content...

Provided methods

fn stroke_opts(self, opts: StrokeOptions) -> Self[src]

Specify the whole set of stroke tessellation options.

fn start_cap(self, cap: LineCap) -> Self[src]

The start line cap as specified by the SVG spec.

fn end_cap(self, cap: LineCap) -> Self[src]

The end line cap as specified by the SVG spec.

fn caps(self, cap: LineCap) -> Self[src]

The start and end line cap as specified by the SVG spec.

fn start_cap_butt(self) -> Self[src]

The stroke for each sub-path does not extend beyond its two endpoints. A zero length sub-path will therefore not have any stroke.

fn start_cap_square(self) -> Self[src]

At the end of each sub-path, the shape representing the stroke will be extended by a rectangle with the same width as the stroke width and whose length is half of the stroke width. If a sub-path has zero length, then the resulting effect is that the stroke for that sub-path consists solely of a square with side length equal to the stroke width, centered at the sub-path’s point.

fn start_cap_round(self) -> Self[src]

At each end of each sub-path, the shape representing the stroke will be extended by a half circle with a radius equal to the stroke width. If a sub-path has zero length, then the resulting effect is that the stroke for that sub-path consists solely of a full circle centered at the sub-path’s point.

fn end_cap_butt(self) -> Self[src]

The stroke for each sub-path does not extend beyond its two endpoints. A zero length sub-path will therefore not have any stroke.

fn end_cap_square(self) -> Self[src]

At the end of each sub-path, the shape representing the stroke will be extended by a rectangle with the same width as the stroke width and whose length is half of the stroke width. If a sub-path has zero length, then the resulting effect is that the stroke for that sub-path consists solely of a square with side length equal to the stroke width, centered at the sub-path’s point.

fn end_cap_round(self) -> Self[src]

At each end of each sub-path, the shape representing the stroke will be extended by a half circle with a radius equal to the stroke width. If a sub-path has zero length, then the resulting effect is that the stroke for that sub-path consists solely of a full circle centered at the sub-path’s point.

fn caps_butt(self) -> Self[src]

The stroke for each sub-path does not extend beyond its two endpoints. A zero length sub-path will therefore not have any stroke.

fn caps_square(self) -> Self[src]

At the end of each sub-path, the shape representing the stroke will be extended by a rectangle with the same width as the stroke width and whose length is half of the stroke width. If a sub-path has zero length, then the resulting effect is that the stroke for that sub-path consists solely of a square with side length equal to the stroke width, centered at the sub-path’s point.

fn caps_round(self) -> Self[src]

At each end of each sub-path, the shape representing the stroke will be extended by a half circle with a radius equal to the stroke width. If a sub-path has zero length, then the resulting effect is that the stroke for that sub-path consists solely of a full circle centered at the sub-path’s point.

fn join(self, join: LineJoin) -> Self[src]

The way in which lines are joined at the vertices, matching the SVG spec.

Default value is MiterClip.

fn join_miter(self) -> Self[src]

A sharp corner is to be used to join path segments.

fn join_miter_clip(self) -> Self[src]

Same as a join_miter, but if the miter limit is exceeded, the miter is clipped at a miter length equal to the miter limit value multiplied by the stroke width.

fn join_round(self) -> Self[src]

A round corner is to be used to join path segments.

fn join_bevel(self) -> Self[src]

A bevelled corner is to be used to join path segments. The bevel shape is a triangle that fills the area between the two stroked segments.

fn stroke_weight(self, stroke_weight: f32) -> Self[src]

The total stroke_weight (aka width) of the line.

fn miter_limit(self, limit: f32) -> Self[src]

Describes the limit before miter lines will clip, as described in the SVG spec.

Must be greater than or equal to 1.0.

fn stroke_tolerance(self, tolerance: f32) -> Self[src]

Maximum allowed distance to the path when building an approximation.

Loading content...

Implementations on Foreign Types

impl SetStroke for Option<StrokeOptions>[src]

Loading content...

Implementors

impl<S> SetStroke for Arrow<S>[src]

impl<S> SetStroke for Ellipse<S>[src]

impl<S> SetStroke for Line<S>[src]

impl<S> SetStroke for PolygonInit<S>[src]

impl<S> SetStroke for Quad<S>[src]

impl<S> SetStroke for Rect<S>[src]

impl<S> SetStroke for Tri<S>[src]

impl<S> SetStroke for PathStroke<S>[src]

Loading content...