def outline.cap

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

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

1578# The cap at point p leaving in direction u, between the offsets p + r n and
1579# p - r n (which the sides push): nothing for butt.
1580def outline.cap(cap: U32, +p: Point, +u: Point, +r: F32, +scale: F32, acc: List<&2, Point>) -> List<&2, Point>:
1581  match cap:
1582    case 1: outline.sweep(p, r, point.normal(u), F32.neg(3.141592653589793), scale, acc)
1583    case 2:
1584      +n = point.scale(point.normal(u), r)
1585      +ahead = point.add(p, point.scale(u, r))
1586      Con{point.sub(ahead, n), Con{point.add(ahead, n), acc}}
1587    case _: acc

Uses (13)

Used by (2)