gliffy / canvas2svg

Translates HTML5 Canvas draw commands to SVG
MIT License
691 stars 157 forks source link

ctx.fill("evenodd") doesn't work + fix #62

Open murkle opened 6 years ago

murkle commented 6 years ago

ctx.fill("evenodd") doesn't take account of the parameter. Simple fix is to change method to

    ctx.prototype.fill = function (fillRule) {
        if (this.__currentElement.nodeName === "path") {
            this.__currentElement.setAttribute("paint-order", "stroke fill markers");
            if (fillRule == "evenodd") {
                this.__currentElement.setAttribute("fill-rule", "evenodd");
            } 
        }
        this.__applyCurrentDefaultPath();
        this.__applyStyleToCurrentElement("fill");
    };