Use Base objects for drawing params, so we can use param.extend() on them for easier overriding.

This commit is contained in:
Jürg Lehni 2013-06-11 20:40:44 -07:00
parent a7750c3e67
commit 20f7c567aa
6 changed files with 18 additions and 16 deletions
src/project

View file

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