mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-07-27 22:29:11 -04:00
Improve clipping mask drawing, and remove some unneeded ctx.save() / ctx.restore() calls.
This commit is contained in:
parent
1581d44c06
commit
f110038104
2 changed files with 9 additions and 9 deletions
src/path
|
@ -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
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue