From fc52944ee8a9e8a6fd02a97e278e3f1c89846995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= <juerg@scratchdisk.com> Date: Tue, 17 May 2011 13:43:45 +0100 Subject: [PATCH] Change method sequence a bit. --- src/ui/View.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/ui/View.js b/src/ui/View.js index 1ba91e7a..4332de0d 100644 --- a/src/ui/View.js +++ b/src/ui/View.js @@ -152,6 +152,13 @@ var View = this.View = Base.extend({ this._transform(new Matrix().translate(Point.read(arguments).negate())); }, + _transform: function(matrix, flags) { + this._matrix.preConcatenate(matrix); + // Force recalculation of these values next time they are requested. + this._bounds = null; + this._inverse = null; + }, + draw: function() { if (this._stats) this._stats.update(); @@ -184,19 +191,6 @@ var View = this.View = Base.extend({ return !!res.length; }, - _transform: function(matrix, flags) { - this._matrix.preConcatenate(matrix); - // Force recalculation of these values next time they are requested. - this._bounds = null; - this._inverse = null; - }, - - _getInverse: function() { - if (!this._inverse) - this._inverse = this._matrix.createInverse(); - return this._inverse; - }, - // TODO: getInvalidBounds // TODO: invalidate(rect) // TODO: style: artwork / preview / raster / opaque / ink @@ -213,6 +207,12 @@ var View = this.View = Base.extend({ return this._getInverse()._transformPoint(Point.read(arguments)); }, + _getInverse: function() { + if (!this._inverse) + this._inverse = this._matrix.createInverse(); + return this._inverse; + }, + /** * Handler to be called whenever a view gets resized. */