From c50b940ff31f1bac054912c4e9b94512b8182181 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Thu, 18 Apr 2013 16:23:27 -0700 Subject: [PATCH] Fix Item#rasterize() to work with new matrices history code. --- src/item/Item.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/item/Item.js b/src/item/Item.js index b5e14b11..58d8e8e9 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -1259,11 +1259,11 @@ var Item = this.Item = Base.extend(Callback, { var bounds = this.getStrokeBounds(), scale = (resolution || 72) / 72, canvas = CanvasProvider.getCanvas(bounds.getSize().multiply(scale)), - ctx = canvas.getContext('2d'); + ctx = canvas.getContext('2d'), + matrix = new Matrix().scale(scale).translate(-bounds.x, -bounds.y); ctx.save(); - new Matrix().scale(scale).translate(-bounds.x, -bounds.y) - .applyToContext(ctx); - Item.draw(this, ctx, {}); + matrix.applyToContext(ctx); + Item.draw(this, ctx, { transforms: [matrix] }); var raster = new Raster(canvas); raster.setBounds(bounds); ctx.restore();