fix: a line shape of no height draws again
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
This commit is contained in:
1 parent
f4870ca4d3
commit
90132fd384
1 file changed
+7
-2
@@ -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 =
|
||||
`<path d="${paths.line}" fill="none" stroke="${color}" stroke-width="${stroke}"/>` +
|
||||
paths.heads.map((d) => `<path d="${d}" fill="${color}"/>`).join('');
|
||||
|
||||
Reference in new issue
Block a user