diff --git a/src/path/CompoundPath.js b/src/path/CompoundPath.js index 221d4e85..c3be55ea 100644 --- a/src/path/CompoundPath.js +++ b/src/path/CompoundPath.js @@ -120,14 +120,16 @@ var CompoundPath = this.CompoundPath = PathItem.extend(/** @lends CompoundPath# param.compound = true; for (var i = 0, l = children.length; i < l; i++) Item.draw(children[i], ctx, param); - if (this._clipMask) - ctx.clip(); param.compound = false; - this._setStyles(ctx); - if (style._fillColor) - ctx.fill(); - if (style._strokeColor) - ctx.stroke(); + if (this._clipMask) { + ctx.clip(); + } else { + this._setStyles(ctx); + if (style._fillColor) + ctx.fill(); + if (style._strokeColor) + ctx.stroke(); + } } }, new function() { // Injection scope for PostScript-like drawing functions /** diff --git a/src/path/Path.js b/src/path/Path.js index 9679912a..7ebcbe8b 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -1489,7 +1489,6 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{ } else if (!param.compound && (fillColor || strokeColor)) { // If the path is part of a compound path or doesn't have a fill // or stroke, there is no need to continue. - ctx.save(); this._setStyles(ctx); if (fillColor) ctx.fill(); @@ -1509,7 +1508,6 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{ } ctx.stroke(); } - ctx.restore(); } },