mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-17 09:36:45 +00:00
The Contextual Task Bar and the Control bar check, each time they are drawn, whether the selection holds a color that Recolor Artwork can change. The check walked the whole subtree of each selected object even after the first color, so with one large group selected, the check read every paint in the group. - Node::try_walk visits in walk's order and ends at a ControlFlow::Break. - swatches::node_has_colors stops at the first color node_colors would visit; node_colors now runs the same visitor without stopping, so the two read the same nodes and paints in the same order. - has_colors in the task bar uses node_has_colors. The result is the same for every selection. On one group of 100,000 paths, the check takes 16 ns instead of 14.5 ms when the first path is filled; when only the last path is filled, or none is, it costs about what the full walk costs.