mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-08 20:01:37 +00:00
swatch.addUsedColors and swatch.unused searched lists inside loops over colors and swatches, checking each color against every color or swatch before it. They now keep the same ordered lists and use hash sets and maps for membership and lookup. A color's key is its model and the bits of its components with -0.0 read as 0.0, so the key agrees with `==`; a color with a NaN component matches nothing, as before. Add Used Colors names its new swatches through Document::free_swatch_names, which collects the taken swatch and color group names once and gives the same names free_swatch_name gives when the swatches are added one at a time. The added swatches, their names, order and links, the undo step, and the swatches Select All Unused lists are unchanged.