From b230e65e74da43e179b4fd571d2abc903bdbada0 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 24 Jan 2019 16:44:36 +0100 Subject: [PATCH] prevent height doubling when resizing caused by mixing up absolute height with incremental height --- src/resizer/distributors/roomsublist2.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/resizer/distributors/roomsublist2.js b/src/resizer/distributors/roomsublist2.js index 2a815cf3b0..2db4db9b80 100644 --- a/src/resizer/distributors/roomsublist2.js +++ b/src/resizer/distributors/roomsublist2.js @@ -71,7 +71,7 @@ export class Layout { openHandle(id) { const index = this._getSectionIndex(id); //log(`openHandle resolved ${id} to ${index}`); - return new Handle(this, index); + return new Handle(this, index, this._originalHeights[index]); } _getAvailableHeight() { @@ -258,13 +258,14 @@ export class Layout { } class Handle { - constructor(layout, anchor) { + constructor(layout, anchor, height) { this._layout = layout; this._anchor = anchor; + this._initialHeight = height; } - setOffset(offset) { - this._layout._relayout(this._anchor, offset); + setHeight(height) { + this._layout._relayout(this._anchor, height - this._initialHeight); } finish() { @@ -283,7 +284,7 @@ export class Distributor extends FixedDistributor { this._handle.finish(); } - resize(offset) { - this._handle.setOffset(offset); + resize(height) { + this._handle.setHeight(height); } }