mirror of
https://github.com/storytold/lightcraft.git
synced 2026-11-01 22:17:53 -06:00
MAX_STROKE_DABS bounds one stroke at two million, but the two callers that will not look at nearly that many check the length after the vector exists, which bounds nothing: it only discards what was already built. gpu/render.rs rejects a brush mask past MAX_DABS, 4096 across the whole mask, after collecting every stroke's dabs. Each stroke may construct two million first, so the sum that rejects them is reached only once they all exist. spots.rs skips an Auto Mask stroke past MAX_DABS_CONSIDERED, 200,000, after brush_dabs has built the whole thing. brush_dabs_within takes the caller's own budget, and push_dabs_within charges against it instead of MAX_STROKE_DABS. Both callers now ask for one more than they accept, so a stroke past the threshold is still recognised as past it without the rest being built: 4097 rather than two million per stroke on the GPU path, 200,001 rather than two million for the spot window. Behaviour is unchanged for anything either caller keeps. A result short of its budget was never truncated, so it is the whole stroke, and a truncated one only ever reaches a caller that was going to reject it. A truncated stroke is not a prefix: running out of room makes a segment lay its remaining dabs further apart rather than stop mid-segment, which is how push_dabs_counted already behaved at MAX_STROKE_DABS.