def paint.limit.block

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

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

5254# The least clip coverage over a block when every clip is uniform there, else -1.
5255def paint.limit.block(clips: List<&2, Clip>, +x0: U32, +y0: U32, +x1: U32, +y1: U32, +acc: F32) -> F32:
5256  match clips:
5257    case Nil{}: acc
5258    case Con{c, rest}:
5259      +u = clip.block(c, x0, y0, x1, y1)
5260      paint.limit.block(rest, x0, y0, x1, y1, U.choose(F32, F32.is_lt(u, 0.0) || F32.is_lt(acc, 0.0), F32.neg(1.0), U.min(acc, u)))

Uses (10)

Used by (1)