mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-20 22:39:50 -05:00
Clean up code and add comment about consumed canvas again.
This commit is contained in:
parent
53b36111dd
commit
4cd069b1af
1 changed files with 5 additions and 4 deletions
|
@ -1102,13 +1102,14 @@ 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'),
|
||||
matrix = new Matrix().scale(scale).translate(-bounds.x, -bounds.y);
|
||||
matrix.applyToContext(ctx);
|
||||
// XXX: Decide how to handle _matrix
|
||||
ctx = canvas.getContext('2d');
|
||||
new Matrix().scale(scale).translate(-bounds.x, -bounds.y)
|
||||
.applyToContext(ctx);
|
||||
Item.draw(this, ctx, {});
|
||||
var raster = new Raster(canvas);
|
||||
raster.setBounds(bounds);
|
||||
// NOTE: We don't need to release the canvas since it now belongs to the
|
||||
// Raster!
|
||||
return raster;
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue