M3: a swapped nested instance keeps its outer main's overrides

A Button main's override on its icon instance's glyph (a red fill) was
lost when an instance swapped the icon: the outer rebuild re-copies the
glyph from the main's layer with no overrides of its own, so the nested
rebuild matched it by name and carried nothing. Before that rebuild, each
old layer of the swapped instance now takes the overrides held along the
source chain it had before this rebuild, through layers inside instances
in the mains that place the swapped instance. Geometry, slot content and
groups the layer overrides itself are left out. Matched by name, the
values carry onto the new main's layer as the instance's own: inherited
at the swap, frozen after, and back to the icon main's value on reset.
An icon main's own overrides stay with it.
This commit is contained in:
MortenHusted
2026-10-22 11:26:04 +02:00
parent a86897dc91
commit c141dee771
3 changed files with 249 additions and 3 deletions
+3 -1
View File
@@ -720,7 +720,9 @@ most when it can't be reached).
- `instance.swap {ids?, component}` shows another component in the instances (overrides on layers
with matching names stay; property values with the same names too). Nested instances can be
swapped on their own (an override of the instance they're in).
swapped on their own (an override of the instance they're in); a swapped nested instance keeps
what its outer main overrode on matching layers as its own, so later edits of those in the main
don't reach it.
- `instance.swapAt {component, x, y}` swaps the instance at a page point: of the instances under
it (innermost first), the first showing a variant of the same component set, else the innermost
(never one inside the dropped component); only text layers keep their overrides. The Assets