A node's `RenderNode.clipStack` carries the ancestor clip chain, NOT this node's own bounds. The previous interaction handlers transformed every entry of clipStack alongside the node's own absX/absY/absW/absH: - drag: translated each entry by (dx, dy) - resize: scaled each entry alongside the resize delta - rotate: rotated each entry around the rotation center That's wrong — the ancestor frames being referenced by those entries aren't being dragged/resized/rotated, so their clip rectangles on screen shouldn't move. The visible result was the clip rectangle drifting away from the actual ancestor during preview. Fix: in all 4 sites (drag mutation loop, resize root preview, resize children iteration, rotate children iteration), restore the snapshot clipStack unchanged (deep-cloned so caller-mutation can't leak back into the snapshot). The node's own pushed clip — if it has clipContent: true — lives in its CHILDREN's clipStack, which the children's flatten will recompute on commit. Brief preview artifact only when the node being transformed has clipContent and its children are simultaneously visible during preview, which is acceptable for an in-flight gesture. Test updated: dragged node's clipStack now stays at its snapshot value. |
||
|---|---|---|
| .. | ||
| public | ||
| server | ||
| src | ||
| CLAUDE.md | ||
| components.json | ||
| dev.ts | ||
| package.json | ||
| tsconfig.json | ||
| vite.config.ts | ||