mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Fix Item#rasterize() to work with new matrices history code.
This commit is contained in:
parent
1333f59d54
commit
c50b940ff3
1 changed files with 4 additions and 4 deletions
|
@ -1259,11 +1259,11 @@ var Item = this.Item = Base.extend(Callback, {
|
||||||
var bounds = this.getStrokeBounds(),
|
var bounds = this.getStrokeBounds(),
|
||||||
scale = (resolution || 72) / 72,
|
scale = (resolution || 72) / 72,
|
||||||
canvas = CanvasProvider.getCanvas(bounds.getSize().multiply(scale)),
|
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();
|
ctx.save();
|
||||||
new Matrix().scale(scale).translate(-bounds.x, -bounds.y)
|
matrix.applyToContext(ctx);
|
||||||
.applyToContext(ctx);
|
Item.draw(this, ctx, { transforms: [matrix] });
|
||||||
Item.draw(this, ctx, {});
|
|
||||||
var raster = new Raster(canvas);
|
var raster = new Raster(canvas);
|
||||||
raster.setBounds(bounds);
|
raster.setBounds(bounds);
|
||||||
ctx.restore();
|
ctx.restore();
|
||||||
|
|
Loading…
Reference in a new issue