From 79661c35e6d623c4598ec6dea8c4a7ae8c0c31a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Wed, 3 Aug 2016 13:33:58 +0200 Subject: [PATCH] Some code cleanup in View#setViewSize() --- src/view/View.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/view/View.js b/src/view/View.js index 88b73db2..c473fc96 100644 --- a/src/view/View.js +++ b/src/view/View.js @@ -382,19 +382,14 @@ var View = Base.extend(Emitter, /** @lends View# */{ setViewSize: function(/* size */) { var size = Size.read(arguments), - width = size.width, - height = size.height, delta = size.subtract(this._viewSize); if (delta.isZero()) return; - this._setElementSize(width, height); - this._viewSize._set(width, height); + this._setElementSize(size.width, size.height); + this._viewSize.set(size); this._changed(); // Emit resize event on any size changes. - this.emit('resize', { - size: size, - delta: delta - }); + this.emit('resize', { size: size, delta: delta }); if (this._autoUpdate) { // Update right away, don't wait for the next animation frame as // otherwise the view would flicker during resizes, see #1126