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('');