Skip to main content

walk_contour

Function walk_contour 

Source
fn walk_contour<C: PointCoord>(
    len: usize,
    point: impl Fn(usize) -> ContourPoint<C>,
    start: PathContourStart,
    sink: &mut impl PathSink,
) -> bool
Expand description

Emits one contour, reading its points by index.

Indexing rather than iterating is what keeps this to one loop: finding the start may consult the last point or the second, and the walk that follows is a rotation of the contour, which an iterator cannot express without stashing the points it had to skip.