Merge pull request #26 from zenozeng/paint-order
set paint order before stroke and fill to make them behavior like canvas
This commit is contained in:
commit
9ed0b82b57
@ -693,6 +693,9 @@
|
|||||||
* Sets the stroke property on the current element
|
* Sets the stroke property on the current element
|
||||||
*/
|
*/
|
||||||
ctx.prototype.stroke = function(){
|
ctx.prototype.stroke = function(){
|
||||||
|
if(this.__currentElement.nodeName === "path") {
|
||||||
|
this.__currentElement.setAttribute("paint-order", "fill stroke markers");
|
||||||
|
}
|
||||||
this.__applyCurrentDefaultPath();
|
this.__applyCurrentDefaultPath();
|
||||||
this.__applyStyleToCurrentElement("stroke");
|
this.__applyStyleToCurrentElement("stroke");
|
||||||
};
|
};
|
||||||
@ -701,6 +704,9 @@
|
|||||||
* Sets fill properties on the current element
|
* Sets fill properties on the current element
|
||||||
*/
|
*/
|
||||||
ctx.prototype.fill = function(){
|
ctx.prototype.fill = function(){
|
||||||
|
if(this.__currentElement.nodeName === "path") {
|
||||||
|
this.__currentElement.setAttribute("paint-order", "stroke fill markers");
|
||||||
|
}
|
||||||
this.__applyCurrentDefaultPath();
|
this.__applyCurrentDefaultPath();
|
||||||
this.__applyStyleToCurrentElement("fill");
|
this.__applyStyleToCurrentElement("fill");
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user