def line.push

gralha-coverage@0.1.0.1 · cover.bend:189

import gralha-coverage@0.1.0.1/cover.bend as Cover
import Base
import gralha-text-scan@0.1.0.1/scan.bend as U

189# One pass over the lines: shift by the mask's origin, split at the grid's
190# left and right edges and clamp the pieces to it, counting them. Pieces
191# left of 0 or right of w become vertical lines on that edge, which keeps
192# the winding of every cell inside intact.
193def line.push(+ax: F32, +ay: F32, +bx: F32, +by: F32, +w: F32, st: List<&2, CovLine> & U32) -> List<&2, CovLine> & U32:
194  (acc, n) = st
195  (Con{CovLine{U.clamp(ax, 0.0, w), ay, U.clamp(bx, 0.0, w), by}, acc}, (n + 1 : U32))

Uses (8)

Used by (2)