[bug] write_html: <svg> viewBox not scaled to width/height #14

Closed
opened 2026-10-25 03:12:27 +00:00 by masi · 0 comments
Owner

Expected: <svg width="120" height="34" viewBox="0 0 200 56"> scales the path down to fit 120×34, as in a browser.
Actual: the frame is 120×34 but the path keeps its 200×56 viewBox size and overflows onto neighbouring layers.
Repro: write_html insert-children into a flex row: <svg width="100" height="20" viewBox="0 0 200 40"><path d="M0 20H200" stroke="#000" stroke-width="2"/></svg><div>Text</div> — the line runs under the text.
Workaround: set width/height equal to the viewBox size.
Impact: scaled-down icons/signatures silently overlap content; only visible in a screenshot.


Filed from PaperCraft 0.7.2 (macos).

**Expected:** `<svg width="120" height="34" viewBox="0 0 200 56">` scales the path down to fit 120×34, as in a browser. **Actual:** the frame is 120×34 but the path keeps its 200×56 viewBox size and overflows onto neighbouring layers. **Repro:** write_html insert-children into a flex row: `<svg width="100" height="20" viewBox="0 0 200 40"><path d="M0 20H200" stroke="#000" stroke-width="2"/></svg><div>Text</div>` — the line runs under the text. **Workaround:** set width/height equal to the viewBox size. **Impact:** scaled-down icons/signatures silently overlap content; only visible in a screenshot. --- Filed from PaperCraft 0.7.2 (macos).
masi closed this issue 2026-10-25 06:54:23 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: masi/papercraft#14