mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-08-10 21:19:10 -04:00
Use Base objects for drawing params, so we can use param.extend() on them for easier overriding.
This commit is contained in:
parent
a7750c3e67
commit
20f7c567aa
6 changed files with 18 additions and 16 deletions
src/project
|
@ -299,12 +299,14 @@ var Project = PaperScopeItem.extend(/** @lends Project# */{
|
|||
this._drawCount++;
|
||||
ctx.save();
|
||||
matrix.applyToContext(ctx);
|
||||
var param = {
|
||||
// Use Base.merge() so we can use param.extend() to easily override
|
||||
// values
|
||||
var param = Base.merge({
|
||||
offset: new Point(0, 0),
|
||||
// A stack of concatenated matrices, to keep track of the current
|
||||
// global matrix, since Canvas is not able tell us (yet).
|
||||
transforms: [matrix]
|
||||
};
|
||||
});
|
||||
for (var i = 0, l = this.layers.length; i < l; i++)
|
||||
this.layers[i].draw(ctx, param);
|
||||
ctx.restore();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue