openpencil/packages
Fini 138df33309 fix(renderer): coerce missing shadow numeric fields + isolate per-node draw
User reported "为什么画布是空的" — Bistro DeepSeek generation, layer
panel populated with the root frame but canvas fully blank mid-stream.
The MCP-side document showed children, the UI-side layer tree showed
the root, but no pixels rendered. Two structural issues converged:

1. ShadowEffect TS type marks offsetX / offsetY / blur / spread as
   required, but LLM-emitted shadows routinely omit them
   (`{type:'shadow', blur:3, color:'#0000001A'}` with no spread). The
   prior (and the new shadow-cornerRadius) code multiplied the missing
   field through cornerRadius / RRectXY math, producing NaN. CanvasKit's
   RRectXY throws on NaN inside the WASM module, the throw escapes
   drawNode (renderer.ts:326 had no try/catch), and the entire render
   loop aborts past the bad node — so even unrelated siblings stop
   drawing. User sees a fully empty canvas despite document state
   being intact.

2. The drawNode loop had zero error isolation — a single malformed
   node could blank the whole frame. Structural fragility independent
   of the NaN bug; any future renderer regression would have the same
   symptom.

Two fixes:

 - applyShadowDirect coerces missing / non-finite shadow numeric
   fields to 0 before any math (offsetX / offsetY / spread defaults
   to 0; blur defaults to 0 and clamps non-negative). NaN can't reach
   CanvasKit. The pre-existing drawRect path also benefits — the old
   code happily fed NaN to drawRect via `x + shadow.offsetX -
   shadow.spread`, just relied on Skia's tolerance for some NaN cases.
 - renderer.ts wraps drawNode in per-node try/catch with a console.error
   on failure. A bad node now logs and skips; siblings render normally.
   Defense-in-depth so the next renderer regression doesn't blank the
   canvas.
2026-05-10 22:54:01 +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): coerce missing shadow numeric fields + isolate per-node draw 2026-05-10 22:54:01 +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