diff --git a/src/core/xfa/template.js b/src/core/xfa/template.js index ba4f88c0a..b3cabb5f8 100644 --- a/src/core/xfa/template.js +++ b/src/core/xfa/template.js @@ -181,7 +181,9 @@ class Arc extends XFAObject { } else { style.fill = "transparent"; } - style.strokeWidth = measureToString(Math.round(edge.thickness)); + style.strokeWidth = measureToString( + edge.presence === "visible" ? Math.round(edge.thickness) : 0 + ); style.stroke = edgeStyle.color; let arc; const attributes = { @@ -2951,16 +2953,18 @@ class Line extends XFAObject { const edge = this.edge ? this.edge : new Edge({}); const edgeStyle = edge[$toStyle](); const style = Object.create(null); - style.strokeWidth = measureToString(Math.round(edge.thickness)); + const thickness = + edge.presence === "visible" ? Math.round(edge.thickness) : 0; + style.strokeWidth = measureToString(thickness); style.stroke = edgeStyle.color; let x1, y1, x2, y2; let width = "100%"; let height = "100%"; - if (parent.w <= edge.thickness) { + if (parent.w <= thickness) { [x1, y1, x2, y2] = ["50%", 0, "50%", "100%"]; width = style.strokeWidth; - } else if (parent.h <= edge.thickness) { + } else if (parent.h <= thickness) { [x1, y1, x2, y2] = [0, "50%", "100%", "50%"]; height = style.strokeWidth; } else { @@ -3801,7 +3805,9 @@ class Rectangle extends XFAObject { } else { style.fill = "transparent"; } - style.strokeWidth = measureToString(2 * edge.thickness); + style.strokeWidth = measureToString( + edge.presence === "visible" ? 2 * edge.thickness : 0 + ); style.stroke = edgeStyle.color; const corner = this.corner.children.length