mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
Add opacity support in Path#draw.
This commit is contained in:
parent
c2849b3692
commit
2b1dee1bd4
1 changed files with 3 additions and 0 deletions
|
@ -367,6 +367,8 @@ Path = PathItem.extend({
|
|||
}
|
||||
if(!compound) {
|
||||
this.setCtxStyles(ctx);
|
||||
ctx.save();
|
||||
ctx.globalAlpha = this.opacity;
|
||||
if (this.fillColor) {
|
||||
ctx.fillStyle = this.fillColor.getCssString();
|
||||
ctx.fill();
|
||||
|
@ -375,6 +377,7 @@ Path = PathItem.extend({
|
|||
ctx.strokeStyle = this.strokeColor.getCssString();
|
||||
ctx.stroke();
|
||||
}
|
||||
ctx.restore();
|
||||
}
|
||||
}
|
||||
}, new function() { // inject methods that require scoped privates
|
||||
|
|
Loading…
Reference in a new issue