mirror of
https://github.com/storytold/texturecraft.git
synced 2026-11-30 10:03:56 +01:00
Review findings on #421: - A huge but finite coordinate saturated a cell index to i32::MAX, and the next neighbour index overflowed, which panics in debug builds; an infinite one gave NaN. As the six tilings repeat every unit, each now first moves the point into the unit square, which also keeps far coordinates precise. Coordinates that are not finite become 0. - Halftone dots picked a single center by rounding, so on the line halfway between two centers the dot jumped from one size to the other. Each texel now takes the dot that covers it most among the four nearest centers, and skips the tone of centers no dot could reach from there. New tests feed extreme coordinates to every tiling and check that the halftone has no jump where two dots meet; both fail without the change. Halftone dots now take about 97 ns per texel in release. Part of #409