mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -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) {
|
if(!compound) {
|
||||||
this.setCtxStyles(ctx);
|
this.setCtxStyles(ctx);
|
||||||
|
ctx.save();
|
||||||
|
ctx.globalAlpha = this.opacity;
|
||||||
if (this.fillColor) {
|
if (this.fillColor) {
|
||||||
ctx.fillStyle = this.fillColor.getCssString();
|
ctx.fillStyle = this.fillColor.getCssString();
|
||||||
ctx.fill();
|
ctx.fill();
|
||||||
|
@ -375,6 +377,7 @@ Path = PathItem.extend({
|
||||||
ctx.strokeStyle = this.strokeColor.getCssString();
|
ctx.strokeStyle = this.strokeColor.getCssString();
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
}
|
}
|
||||||
|
ctx.restore();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, new function() { // inject methods that require scoped privates
|
}, new function() { // inject methods that require scoped privates
|
||||||
|
|
Loading…
Reference in a new issue