mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-19 00:55:12 +00:00
Each gradient fill or stroke, and each gradient swatch, looked for its definition by comparing its gradient with every definition written so far, and each new definition's name was checked against every other name. A document with thousands of distinct gradients spent most of the editing data's time in these comparisons. The writer now keeps the definitions' names in a map and the definitions no swatch names under a key made from every field of their gradient (a zero of either sign giving the same key). Each candidate under a key is still compared in full, the first in definition order is used, and a style that isn't written frees the names and keys of the definitions it added. Pattern definitions are found by name the same way. The written program is unchanged, byte for byte.