add stroke-opacity and fill-opacity because some archaic svg viewer
don't understand "transparent"
This commit is contained in:
parent
3d4830b67c
commit
b7ae69020a
2
draw.js
2
draw.js
|
|
@ -575,6 +575,7 @@ var DrawingElement = new Lang.Class({
|
||||||
let color = this.eraser ? bgColor : this.color.to_string();
|
let color = this.eraser ? bgColor : this.color.to_string();
|
||||||
let attributes = `fill="${this.fill ? color : 'transparent'}" ` +
|
let attributes = `fill="${this.fill ? color : 'transparent'}" ` +
|
||||||
`stroke="${this.fill ? 'transparent' : color}" ` +
|
`stroke="${this.fill ? 'transparent' : color}" ` +
|
||||||
|
`${this.fill ? 'stroke-opacity="0"' : 'fill-opacity="0"'} ` +
|
||||||
`stroke-width="${this.line.lineWidth}" ` +
|
`stroke-width="${this.line.lineWidth}" ` +
|
||||||
`stroke-linecap="${LineCapNames[this.line.lineCap].toLowerCase()}" ` +
|
`stroke-linecap="${LineCapNames[this.line.lineCap].toLowerCase()}" ` +
|
||||||
`stroke-linejoin="${LineJoinNames[this.line.lineJoin].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) {
|
} else if (this.shape == Shapes.TEXT && points.length == 2) {
|
||||||
attributes = `fill="${color}" ` +
|
attributes = `fill="${color}" ` +
|
||||||
`stroke="transparent" ` +
|
`stroke="transparent" ` +
|
||||||
|
`stroke-opacity="0" ` +
|
||||||
`font-family="${this.font.family}" ` +
|
`font-family="${this.font.family}" ` +
|
||||||
`font-size="${Math.abs(points[1][1] - points[0][1])}" ` +
|
`font-size="${Math.abs(points[1][1] - points[0][1])}" ` +
|
||||||
`font-weight="${FontWeightNames[this.font.weight].toLowerCase()}" ` +
|
`font-weight="${FontWeightNames[this.font.weight].toLowerCase()}" ` +
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue