From b7ae69020a0182822a8f7cd52a055fa828afa171 Mon Sep 17 00:00:00 2001 From: abakkk Date: Wed, 6 Mar 2019 01:36:23 +0100 Subject: [PATCH] add stroke-opacity and fill-opacity because some archaic svg viewer don't understand "transparent" --- draw.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/draw.js b/draw.js index ef27dc1..8644eab 100644 --- a/draw.js +++ b/draw.js @@ -575,6 +575,7 @@ var DrawingElement = new Lang.Class({ let color = this.eraser ? bgColor : this.color.to_string(); let attributes = `fill="${this.fill ? color : 'transparent'}" ` + `stroke="${this.fill ? 'transparent' : color}" ` + + `${this.fill ? 'stroke-opacity="0"' : 'fill-opacity="0"'} ` + `stroke-width="${this.line.lineWidth}" ` + `stroke-linecap="${LineCapNames[this.line.lineCap].toLowerCase()}" ` + `stroke-linejoin="${LineJoinNames[this.line.lineJoin].toLowerCase()}"`; @@ -599,6 +600,7 @@ var DrawingElement = new Lang.Class({ } else if (this.shape == Shapes.TEXT && points.length == 2) { attributes = `fill="${color}" ` + `stroke="transparent" ` + + `stroke-opacity="0" ` + `font-family="${this.font.family}" ` + `font-size="${Math.abs(points[1][1] - points[0][1])}" ` + `font-weight="${FontWeightNames[this.font.weight].toLowerCase()}" ` +