mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-15 11:16:25 +00:00
Measuring an instance of a symbol with 9-slice guides looked its map up through Document::symbol_slice_map, which scanned the symbol list and measured the art box again in new quick boxes, and NineSliceMap::place and most_placed made new quick boxes of their own. Each of those boxes built the symbol name index over the whole list on its first lookup, so every 9-slice instance measured read every symbol once or more. Picking an object inside a 9-slice instance's art with Direct Selection did the same for each object of the art that holds a symbol instance. - SymbolBoxes cuts the guides through the art box it has measured (SymbolBoxes::slice_map), and places and counts the art with itself as the boxes, in the mode quick boxes use. Art with no 9-slice map is moved by the instance's transform without looking the map up again. - Document::symbol_slice_map, place_symbol_art, place_symbol_art_unclipped and edited_nine_slice use one set of quick boxes for each call. - symbol_part_at and symbol_part_outline keep one set of quick boxes for the instance's art. The new tests count the symbols read. Measuring 200 instances of a symbol with guides and 200 of a symbol with guides holding it, among 2,002 symbols, read 1,205,204 symbols before; now each set of boxes reads the list once. Picking in a 9-slice instance whose art holds 20 instances read 84,042 symbols among 2,001; now it reads the list at most twice.