From 2b1dee1bd46a60f7424a7768127d5a84453fe3ad Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Sat, 19 Feb 2011 17:33:23 +0100 Subject: [PATCH] Add opacity support in Path#draw. --- src/path/Path.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/path/Path.js b/src/path/Path.js index 403b9970..8c794cc0 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -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