From 90132fd384db5ab86e4af2c64c0412ff53a612a4 Mon Sep 17 00:00:00 2001 From: Steffen Becker Date: Thu, 10 Sep 2026 23:40:57 +0200 Subject: [PATCH] fix: a line shape of no height draws again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A divider line is written as a frame of zero height, and the node view handed that straight to the SVG's viewBox and viewport — a zero-high viewport turns rendering off altogether, so the line was simply absent. The viewport is now at least the stroke, which it overflows by half as in any flat frame. Claude-Session: https://claude.ai/code/session_01Wzs2qG6Y5qm7mKmJHfu44G --- src/lib/editor/extensions/textBox.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib/editor/extensions/textBox.ts b/src/lib/editor/extensions/textBox.ts index 3138cf4..7855c84 100644 --- a/src/lib/editor/extensions/textBox.ts +++ b/src/lib/editor/extensions/textBox.ts @@ -584,9 +584,14 @@ class TextBoxView { this.rotor.insertBefore(this.lineSvg, this.rotor.firstChild); } const color = a.strokeColor ?? '#000000'; - this.lineSvg.setAttribute('viewBox', `0 0 ${w} ${h}`); + // A frame of no height (the divider line both word processors write) would give the + // SVG a zero-high viewport, and that turns rendering off entirely — the stroke needs + // one of its own, which it then overflows by half as it does in any flat frame. + const vh = Math.max(h, stroke); + this.lineSvg.setAttribute('viewBox', `0 0 ${w} ${vh}`); this.lineSvg.setAttribute('width', `${w}`); - this.lineSvg.setAttribute('height', `${h}`); + this.lineSvg.setAttribute('height', `${vh}`); + this.lineSvg.style.height = `${vh}px`; this.lineSvg.innerHTML = `` + paths.heads.map((d) => ``).join('');