mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-04 03:45:58 -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(),
|
||||
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();
|
||||
|
|
Loading…
Reference in a new issue