def paint.pieces

gralha-svg-render@0.1.0.1 · svg.bend:5585

import gralha-svg-render@0.1.0.1/svg.bend as Svg
import Base

5585# The fill, stroke and markers of a shape in its paint order (see
5586# paint.order.first): each arm hands the fill's and the stroke's masks to
5587# exactly one painter, so the masks are never shared and walked as copies.
5588def paint.pieces(order: U32, fb: Array<U32>, +fills: Bool, +strokes: Bool, ink: Paint<Brush>, +inv: Matrix, outline: StrokeMesh, f: Fill, markers: Array<U32> -> Array<U32>, +linear: Bool, +clips: List<&2, Clip>, +tg: Target) -> Array<U32>:
5589  match order:
5590    case 0:
5591      Paint{fc, sc} = ink
5592      markers(paint.stroke.if(strokes, paint.fill.if(fills, fb, f, fc, inv, linear, clips, tg), outline, sc, inv, linear, clips, tg))
5593    case 1:
5594      Paint{fc, sc} = ink
5595      paint.stroke.if(strokes, markers(paint.fill.if(fills, fb, f, fc, inv, linear, clips, tg)), outline, sc, inv, linear, clips, tg)
5596    case 2:
5597      Paint{fc, sc} = ink
5598      markers(paint.fill.if(fills, paint.stroke.if(strokes, fb, outline, sc, inv, linear, clips, tg), f, fc, inv, linear, clips, tg))
5599    case 3:
5600      Paint{fc, sc} = ink
5601      paint.fill.if(fills, markers(paint.stroke.if(strokes, fb, outline, sc, inv, linear, clips, tg)), f, fc, inv, linear, clips, tg)
5602    case 4:
5603      Paint{fc, sc} = ink
5604      paint.stroke.if(strokes, paint.fill.if(fills, markers(fb), f, fc, inv, linear, clips, tg), outline, sc, inv, linear, clips, tg)
5605    case _:
5606      Paint{fc, sc} = ink
5607      paint.fill.if(fills, paint.stroke.if(strokes, markers(fb), outline, sc, inv, linear, clips, tg), f, fc, inv, linear, clips, tg)

Uses (15)

Used by (1)