mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-08 05:42:07 -05:00
Update View size before calling View#onResize.
This commit is contained in:
parent
ff685f294a
commit
595144961d
1 changed files with 5 additions and 5 deletions
|
@ -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.
|
||||||
|
|
Loading…
Reference in a new issue