mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-21 09:26:43 +00:00
Review follow-up. The palette step quantised the whole stroke damage rectangle as one dense buffer. A long diagonal stroke on a large canvas has a rectangle near the size of the document, so this allocated about 28 bytes per pixel of it. It also remapped pixels inside that rectangle the brush never touched, which can already be off the table (Paint Bucket doesn't snap yet). keep_in_color_table now walks the rectangle tile by tile and maps only the pixels that differ from the surface before the stroke (a cheap clone: tiles are shared until written). The live preview compares against its own pre-stroke surface the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>