def line.on.box
import gralha-coverage@0.1.0.1/cover.bend as Coverimport Base
1180# A closed rectangle on whole pixels: four axis-aligned lines on the box edges
1181# with integer coordinates (the usual viewport clip and the common rect), whose
1182# mask is a tree of full and empty leaves with no scan at all.
1183def line.on.box(+ax: F32, +ay: F32, +bx: F32, +by: F32, +x0: F32, +y0: F32, +x1: F32, +y1: F32) -> Bool:
1184 (F32.is_eq(ax, bx) && (F32.is_eq(ax, x0) || F32.is_eq(ax, x1))) || (F32.is_eq(ay, by) && (F32.is_eq(ay, y0) || F32.is_eq(ay, y1)))