mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-12 21:23:02 +00:00
A large sampled-tip brush (an imported .abr with a Dual Brush, at 800 px on a 4K canvas) spent most of each live frame on pixels that could never be painted: - A sampled dab was rasterised over the square that fits the tip at any angle. It now uses the rotated tip's own box, and in each row only the run of pixels whose tip coordinates can land on the tip (solved from the affine pixel-to-tip map, with slack; every pixel in the run still takes the exact test). - The live preview composited the smoothing tail's tiles twice and restored the previous tail over tiles that get rewritten anyway. `composite_live` does each tile once. - The composite looked up the Dual Brush tile per pixel; it now does it per tile. - Tip, texture and pattern sampling use a truncating floor (the baseline x86-64 build makes `f32::floor` a libm call) and an interior fast path without edge checks, with the same arithmetic. Pixels are unchanged: new tests compare the tight box and row runs with a full scan at many angles, flips, roundness and projection, and the live preview with the finished stroke after every chunk. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>