mirror of
https://github.com/storytold/figcraft.git
synced 2026-11-29 01:34:37 +01:00
Switching an instance to another variant matched its old layers to the new variant's by source and then by name path. When the two variants nest the same text layer differently (text > Label in one, div > text > Label in the other), the path differs, the typed layer matched nothing, and the new variant's own text came back. A text layer of the new variant that nothing else matched now takes the old text layer of the same name, when exactly one layer on each side has that name. Two of one name stay unmatched, since either could be the one typed into. Layers inside nested instances are left to their own mains' rebuild, so a text layer never moves between instances. Matching every layer kind by name alone was left out: a fill or size kept from another place in the tree would land on a layer that only shares a name, while text is what was typed and the layer most likely to be the same one.