set paint order before stroke and fill to make them behavior like canvas

This commit is contained in:
Zeno Zeng 2015-06-10 15:19:57 +08:00
parent a186bb9a95
commit 36dc5f3cd3

View File

@ -580,6 +580,9 @@
* Sets the stroke property on the current element
*/
ctx.prototype.stroke = function(){
if(this.__currentElement.nodeName === "path") {
this.__currentElement.setAttribute("paint-order", "fill stroke markers");
}
this.__applyCurrentDefaultPath();
this.__applyStyleToCurrentElement("stroke");
};
@ -588,6 +591,9 @@
* Sets fill properties on the current element
*/
ctx.prototype.fill = function(){
if(this.__currentElement.nodeName === "path") {
this.__currentElement.setAttribute("paint-order", "stroke fill markers");
}
this.__applyCurrentDefaultPath();
this.__applyStyleToCurrentElement("fill");
};