Fix Item#rasterize() to work with new matrices history code.

This commit is contained in:
Jürg Lehni 2013-04-18 16:23:27 -07:00
parent 1333f59d54
commit c50b940ff3

View file

@ -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();