From b54f9f2228813b8a57ba39319edfc0d1aff4b417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Mon, 22 Aug 2011 11:14:38 +0200 Subject: [PATCH] Introduce View#_redraw() and use it in #setViewSize() and #_transform(). --- src/ui/View.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/ui/View.js b/src/ui/View.js index c7805e47..701b063f 100644 --- a/src/ui/View.js +++ b/src/ui/View.js @@ -161,11 +161,23 @@ var View = this.View = PaperScopeItem.extend(/** @lends View# */{ return true; }, + _redraw: function() { + if (this._onFrameCallback) { + // If there's a _onFrameCallback, call it staight away, + // but without requesting another animation frame. + this._onFrameCallback(0, true); + } else { + // Otherwise simply redraw the view now + this.draw(true); + } + }, + _transform: function(matrix, flags) { this._matrix.preConcatenate(matrix); // Force recalculation of these values next time they are requested. this._bounds = null; this._inverse = null; + this._redraw(); }, /** @@ -208,14 +220,7 @@ var View = this.View = PaperScopeItem.extend(/** @lends View# */{ delta: delta }); } - if (this._onFrameCallback) { - // If there's a _onFrameCallback, call it staight away, - // but without requesting another animation frame. - this._onFrameCallback(0, true); - } else { - // Otherwise simply redraw the view now - this.draw(true); - } + this._redraw(); }, /**