We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
element
1 parent 85cd5a1 commit 015ba10Copy full SHA for 015ba10
canvas2svg.js
@@ -758,11 +758,12 @@
758
*/
759
ctx.prototype.fill = function () {
760
var element = getOrCreateElementToApplyStyleTo.call(this, "fill", "stroke");
761
-
762
- /** `fillRule` could be first or second argument: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fill **/
763
- if (arguments[0] === "evenodd" || arguments[1] === "evenodd") {
764
- element.setAttribute("fill-rule", "evenodd");
765
- }
+ if (element) {
+ /** `fillRule` could be first or second argument: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fill **/
+ if (arguments[0] === "evenodd" || arguments[1] === "evenodd") {
+ element.setAttribute("fill-rule", "evenodd");
+ }
766
767
};
768
769
/**
0 commit comments