openpencil/packages
Fini dd231d4ef2 fix(renderer): per-node catch restores canvas save stack
Codex stop-hook on the prior per-node try/catch caught a leak: the
catch logged but didn't roll back canvas state. drawNode pushes
canvas.save() once per ancestor clipStack entry (node-renderer.ts:548)
plus more for rotation / flip (574, 583) and per-shape sub-paths
(701, 1094, 1102). If drawNode throws mid-loop, every save() between
its entry and the throw stays on the stack — the next node's draw
operates inside a leaked clip / leaked transform, and the canvas
either renders nothing or renders to the wrong region.

Snapshot canvas.getSaveCount() before each drawNode call; on catch,
canvas.restoreToCount(saveCount) pops everything back to the
baseline. Wrap the restoreToCount itself in a no-op catch since it
can throw if the snapshot count is somehow above the current depth
(shouldn't happen but guarded so the error reporter still runs).

Net effect: per-node failures are now genuinely isolated. The
canvas state at the start of each iteration is identical to where
the previous iteration left it; one bad node can't smear its leaked
state across the rest of the frame.
2026-05-10 22:54:02 +08:00
..
agent-native@22f20e42cd Merge branch 'v0.8.0' of github.com:ZSeven-W/openpencil into v0.8.0 2026-05-10 21:37:11 +08:00
pen-acp Merge origin/v0.8.0 into feat/rust-ification 2026-05-03 21:00:00 +08:00
pen-ai-skills Merge branch 'v0.8.0' of github.com:ZSeven-W/openpencil into v0.8.0 2026-05-10 21:37:11 +08:00
pen-core fix(ai): clean card-image corners + strip wrapper stroke/cornerRadius with fill 2026-05-09 21:42:00 +08:00
pen-engine Merge origin/v0.8.0 into feat/rust-ification 2026-05-03 21:00:00 +08:00
pen-figma Merge origin/v0.8.0 into feat/rust-ification 2026-05-03 21:00:00 +08:00
pen-mcp Merge branch 'v0.8.0' of github.com:ZSeven-W/openpencil into v0.8.0 2026-05-10 21:37:11 +08:00
pen-react Merge origin/v0.8.0 into feat/rust-ification 2026-05-03 21:00:00 +08:00
pen-renderer fix(renderer): per-node catch restores canvas save stack 2026-05-10 22:54:02 +08:00
pen-sdk Merge origin/v0.8.0 into feat/rust-ification 2026-05-03 21:00:00 +08:00
pen-types Merge origin/v0.8.0 into feat/rust-ification 2026-05-03 21:00:00 +08:00
CLAUDE.md V0.7.0 (#95) 2026-04-11 23:25:13 +08:00