mirror of
https://github.com/storytold/photocraft.git
synced 2026-10-24 09:57:08 -06:00
auto_slices tested every grid cell against the full slice-rectangle list (covered(x, y) = taken.iter().any(...)). With slice edges forming the grid, that is cubic in the slice count, so a crafted document's slice arrangement could stall ordinary canvas drawing on the UI thread. For each row band, mark covered x-cells in a single pass over the rects that span the band, then scan the precomputed cells. This drops the inner work from O(rects) per cell to O(1), while producing the same tiling. Finding: 9fbea43b-3096-4cdc-b005-86d44a8fe57e (CWE-400)