From ac364014da204e690e6c4d1e8225c9e77df6f1fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 17 May 2011 13:42:20 +0100 Subject: [PATCH] Actually use matrix when drawing view. --- src/ui/View.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ui/View.js b/src/ui/View.js index b0038d8b..fdce8e72 100644 --- a/src/ui/View.js +++ b/src/ui/View.js @@ -158,12 +158,17 @@ var View = this.View = Base.extend({ // Initial tests conclude that clearing the canvas using clearRect // is always faster than setting canvas.width = canvas.width // http://jsperf.com/clearrect-vs-setting-width/7 - var bounds = this._viewBounds; - this._context.clearRect(bounds._x, bounds._y, + var ctx =this._context, + bounds = this._viewBounds; + ctx.clearRect(bounds._x, bounds._y, // TODO: +1... what if we have multiple views in one canvas? bounds._width + 1, bounds._height + 1); + + ctx.save(); + this._matrix.applyToContext(ctx); // Just draw the active project for now - this._scope.project.draw(this._context); + this._scope.project.draw(ctx); + ctx.restore(); }, activate: function() {