def outline.miter.pick
gralha-svg-render@0.1.0.1 · svg.bend:1469
import gralha-svg-render@0.1.0.1/svg.bend as Svg
import Base
import gralha-text-scan@0.1.0.1/scan.bend as U
1469
1470
1471
1472
1473def outline.miter.pick(fits: Bool, clip: Bool, +m: Point, +a: Point, +b: Point, +da: F32, +db: F32, +distance: F32, +reach: F32, acc: List<&2, Point>) -> List<&2, Point>:
1474 match fits:
1475 case True{}: Con{m, acc}
1476 case False{}:
1477 match clip:
1478 case True{}:
1479 Con{point.add(b, point.scale(point.sub(m, b), U.clamp(((reach - db) / (distance - db) : F32), 0.0, 1.0))),
1480 Con{point.add(a, point.scale(point.sub(m, a), U.clamp(((reach - da) / (distance - da) : F32), 0.0, 1.0))), acc}}
1481 case False{}: acc