Update View size before calling View#onResize.

This commit is contained in:
Jonathan Puckey 2011-07-13 14:10:26 +02:00
parent ff685f294a
commit 595144961d

View file

@ -133,6 +133,11 @@ var View = this.View = Base.extend(/** @lends View# */{
return; return;
this._canvas.width = size.width; this._canvas.width = size.width;
this._canvas.height = size.height; 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 // Call onResize handler on any size change
if (this.onResize) { if (this.onResize) {
this.onResize({ this.onResize({
@ -140,11 +145,6 @@ var View = this.View = Base.extend(/** @lends View# */{
delta: delta 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 (this._onFrameCallback) {
// If there's a _onFrameCallback, call it staight away, // If there's a _onFrameCallback, call it staight away,
// but without requesting another animation frame. // but without requesting another animation frame.