Filling and stroking empty paths in SVG backend
This commit is contained in:
parent
92fcfce685
commit
4e8f7070da
@ -1001,9 +1001,11 @@ SVGGraphics = (function SVGGraphicsClosure() {
|
|||||||
|
|
||||||
closePath: function SVGGraphics_closePath() {
|
closePath: function SVGGraphics_closePath() {
|
||||||
var current = this.current;
|
var current = this.current;
|
||||||
var d = current.path.getAttributeNS(null, 'd');
|
if (current.path) {
|
||||||
d += 'Z';
|
var d = current.path.getAttributeNS(null, 'd');
|
||||||
current.path.setAttributeNS(null, 'd', d);
|
d += 'Z';
|
||||||
|
current.path.setAttributeNS(null, 'd', d);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
setLeading: function SVGGraphics_setLeading(leading) {
|
setLeading: function SVGGraphics_setLeading(leading) {
|
||||||
@ -1058,32 +1060,39 @@ SVGGraphics = (function SVGGraphicsClosure() {
|
|||||||
|
|
||||||
fill: function SVGGraphics_fill() {
|
fill: function SVGGraphics_fill() {
|
||||||
var current = this.current;
|
var current = this.current;
|
||||||
current.element.setAttributeNS(null, 'fill', current.fillColor);
|
if (current.element) {
|
||||||
current.element.setAttributeNS(null, 'fill-opacity', current.fillAlpha);
|
current.element.setAttributeNS(null, 'fill', current.fillColor);
|
||||||
|
current.element.setAttributeNS(null, 'fill-opacity', current.fillAlpha);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
stroke: function SVGGraphics_stroke() {
|
stroke: function SVGGraphics_stroke() {
|
||||||
var current = this.current;
|
var current = this.current;
|
||||||
|
|
||||||
current.element.setAttributeNS(null, 'stroke', current.strokeColor);
|
if (current.element) {
|
||||||
current.element.setAttributeNS(null, 'stroke-opacity',
|
current.element.setAttributeNS(null, 'stroke', current.strokeColor);
|
||||||
current.strokeAlpha);
|
current.element.setAttributeNS(null, 'stroke-opacity',
|
||||||
current.element.setAttributeNS(null, 'stroke-miterlimit',
|
current.strokeAlpha);
|
||||||
pf(current.miterLimit));
|
current.element.setAttributeNS(null, 'stroke-miterlimit',
|
||||||
current.element.setAttributeNS(null, 'stroke-linecap', current.lineCap);
|
pf(current.miterLimit));
|
||||||
current.element.setAttributeNS(null, 'stroke-linejoin', current.lineJoin);
|
current.element.setAttributeNS(null, 'stroke-linecap', current.lineCap);
|
||||||
current.element.setAttributeNS(null, 'stroke-width',
|
current.element.setAttributeNS(null, 'stroke-linejoin',
|
||||||
pf(current.lineWidth) + 'px');
|
current.lineJoin);
|
||||||
current.element.setAttributeNS(null, 'stroke-dasharray',
|
current.element.setAttributeNS(null, 'stroke-width',
|
||||||
current.dashArray.map(pf).join(' '));
|
pf(current.lineWidth) + 'px');
|
||||||
current.element.setAttributeNS(null, 'stroke-dashoffset',
|
current.element.setAttributeNS(null, 'stroke-dasharray',
|
||||||
pf(current.dashPhase) + 'px');
|
current.dashArray.map(pf).join(' '));
|
||||||
|
current.element.setAttributeNS(null, 'stroke-dashoffset',
|
||||||
|
pf(current.dashPhase) + 'px');
|
||||||
|
|
||||||
current.element.setAttributeNS(null, 'fill', 'none');
|
current.element.setAttributeNS(null, 'fill', 'none');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
eoFill: function SVGGraphics_eoFill() {
|
eoFill: function SVGGraphics_eoFill() {
|
||||||
this.current.element.setAttributeNS(null, 'fill-rule', 'evenodd');
|
if (this.current.element) {
|
||||||
|
this.current.element.setAttributeNS(null, 'fill-rule', 'evenodd');
|
||||||
|
}
|
||||||
this.fill();
|
this.fill();
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1095,7 +1104,9 @@ SVGGraphics = (function SVGGraphicsClosure() {
|
|||||||
},
|
},
|
||||||
|
|
||||||
eoFillStroke: function SVGGraphics_eoFillStroke() {
|
eoFillStroke: function SVGGraphics_eoFillStroke() {
|
||||||
this.current.element.setAttributeNS(null, 'fill-rule', 'evenodd');
|
if (this.current.element) {
|
||||||
|
this.current.element.setAttributeNS(null, 'fill-rule', 'evenodd');
|
||||||
|
}
|
||||||
this.fillStroke();
|
this.fillStroke();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user