From ce786cc3adf07709ab78a86e6a4a2606c7f1e3f2 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Mon, 28 Apr 2014 21:37:52 +0200 Subject: [PATCH] Transform matrix and isInPathGroup fix for images --- src/shapes/image.class.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/shapes/image.class.js b/src/shapes/image.class.js index c61d0d7a..73887969 100644 --- a/src/shapes/image.class.js +++ b/src/shapes/image.class.js @@ -128,7 +128,7 @@ // this._resetWidthHeight(); if (isInPathGroup) { - ctx.translate(-this.group.width/2 + this.width/2, -this.group.height/2 + this.height/2); + ctx.translate(-this.group.width/2, -this.group.height/2); } if (m) { ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]); @@ -136,6 +136,9 @@ if (!noTransform) { this.transform(ctx); } + if (isInPathGroup) { + ctx.translate(this.width/2, this.height/2); + } ctx.save(); this._setShadow(ctx);