mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-05 21:42:59 -05:00
Every preview of a drag starts again from the document as it was at the press. Its lookup cache does not hold the object the drag adds (a Pencil or Pen path, a shape), so each lookup of that object walked the whole tree, about twice per preview, and the cache was rebuilt only in the preview's own copy. The cache now keeps, beside its table, the index path a walk found for an id the table does not have. Every copy that shares the table reads it and checks it against its own tree before using it, as it does the table's paths, so later previews find the new object at that path. Repeated nodes_in_order calls for such an id count toward a rebuild of the table, and remove and move_node take the parent and the index from one lookup.