def path.smooth

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

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

415# The reflected control point of a smooth curve after a curve of the same
416# kind (commands a or b), else the current point.
417def path.smooth(p: Path, +a: U32, +b: U32) -> Point:
418  Path{cur, start, ctrl, old, prev, es, trace, tol} = p
419  +c = cur
420  +pv = prev
421  U.choose(Point, U32.is_eq(pv, a) || U32.is_eq(pv, b), point.sub(point.scale(c, 2.0), ctrl), c)

Uses (8)

Used by (1)