From 595144961df40723cae9267afd3af9ff68fcd6b8 Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Wed, 13 Jul 2011 14:10:26 +0200 Subject: [PATCH] Update View size before calling View#onResize. --- src/ui/View.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ui/View.js b/src/ui/View.js index 9bf57654..8be21d2c 100644 --- a/src/ui/View.js +++ b/src/ui/View.js @@ -133,6 +133,11 @@ var View = this.View = Base.extend(/** @lends View# */{ return; this._canvas.width = size.width; this._canvas.height = size.height; + // Update _viewSize but don't notify of change. + this._viewSize.set(size.width, size.height, true); + // Force recalculation + this._bounds = null; + this._redrawNeeded = true; // Call onResize handler on any size change if (this.onResize) { this.onResize({ @@ -140,11 +145,6 @@ var View = this.View = Base.extend(/** @lends View# */{ delta: delta }); } - // Update _viewSize but don't notify of change. - this._viewSize.set(size.width, size.height, true); - // Force recalculation - this._bounds = null; - this._redrawNeeded = true; if (this._onFrameCallback) { // If there's a _onFrameCallback, call it staight away, // but without requesting another animation frame.