openpencil/apps
Fini 2d2085deb8 fix(canvas): drag/resize/rotate previews leave ancestor clipStack untouched
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.
2026-04-29 09:50:42 +08:00
..
cli chore(release): bump to v0.8.0 2026-04-27 08:20:00 +08:00
desktop chore(release): bump to v0.8.0 2026-04-27 08:20:00 +08:00
web fix(canvas): drag/resize/rotate previews leave ancestor clipStack untouched 2026-04-29 09:50:42 +08:00