mirror of
https://github.com/storytold/figcraft.git
synced 2026-11-27 17:01:38 +01:00
Copying a variant and pasting with that variant, a layer in it or its set selected pasted an instance on the page: the set was not a place paste could put layers, and a copied main component pastes as an instance of it. Copied variants of one set now paste into that set as new variants (deep copies, like Duplicate makes), under the copied variants where they are now and below the lowest variant with a gap of 20 as Add variant places one, and the set grows to hold them. Only a plain edit.paste with the copied variants' own set, or a layer in it, selected does this: paste decides it and passes it to paste_into's worker, which also checks the target is that set. Inferring it from the parent being a component set made copies of the mains for every other paste into a set too. Those keep making instances: a variant pasted with another set selected, a main that is no variant pasted with a set selected, Paste over and Paste to replace on a sibling variant, and an explicit parent, even the variant's own set. Each has a test. copying_a_variant_pastes_an_instance_but_copying_its_set_keeps_the_components now pastes with nothing selected for its instance case.