openpencil/packages
Fini 220a92c501 fix(renderer): nested clipContent intersects with ancestor clip
Previously `flattenToRenderNodes` overrode the inherited `clipCtx` whenever
a frame had `clipContent: true` (e.g. a card masking its rounded image),
which let the card's children paint past any outer clip — including the
root frame's artboard clip and any horizontal scrolling row's clip.

Repro: a horizontal `clipContent: true` row containing 3 rounded cards
whose total width exceeds the row's visible width. The 3rd card's children
(thumbnail, name text, etc) painted all the way out to the card's own
right edge — past the row, past the root frame, onto the canvas
background.

Fix: introduce `intersectClip(inner, outer)` and use it whenever a nested
clipContent is enabled. `inner` is the new clip we want to introduce (the
current frame's own bounds + cornerRadius); `outer` is the inherited clip
from the ancestor chain. We intersect the rectangles and drop the rounded
corner only if the inner was actually cut on either axis (a single
ClipInfo can't faithfully encode a rrect ∩ rect when the rect cuts inside
a corner).

`outer.rx` is intentionally not propagated — the ambient canvas clip
stack at paint time already enforces the outer rounded shape, so each new
clip just needs to refine the rectangular extent.

Test added: overflowing horizontal scroll row with 3 rounded cards.
Pre-fix: 3rd card's inner text gets clipRect={x:324, w:150}, escaping
the row clip. Post-fix: clipRect={x:324, w:76, rx:0}, properly clipped.
2026-04-29 09:50:40 +08:00
..
agent-native@e1f90cab96 chore(agent): bump agent-native to v0.4.0 release 2026-04-17 19:04:15 +08:00
pen-acp chore(release): bump to v0.8.0 2026-04-27 08:20:00 +08:00
pen-ai-skills fix(ai): JSONL sub-agent path emits design-system refs not hex 2026-04-29 09:50:35 +08:00
pen-core fix(pen-core/variables): resolveNodeForCanvas — fontWeight + empty-vars fallback 2026-04-29 09:50:32 +08:00
pen-engine chore(release): bump to v0.8.0 2026-04-27 08:20:00 +08:00
pen-figma chore(release): bump to v0.8.0 2026-04-27 08:20:00 +08:00
pen-mcp feat(element-tools): add 11 v1 tools with theme parameter (P3 batch 9 — FINAL) 2026-04-29 09:50:29 +08:00
pen-react chore(release): bump to v0.8.0 2026-04-27 08:20:00 +08:00
pen-renderer fix(renderer): nested clipContent intersects with ancestor clip 2026-04-29 09:50:40 +08:00
pen-sdk chore(release): bump to v0.8.0 2026-04-27 08:20:00 +08:00
pen-types chore(release): bump to v0.8.0 2026-04-27 08:20:00 +08:00
CLAUDE.md V0.7.0 (#95) 2026-04-11 23:25:13 +08:00