prevent height doubling when resizing
caused by mixing up absolute height with incremental heightpull/21833/head
parent
a5297303b0
commit
b230e65e74
|
@ -71,7 +71,7 @@ export class Layout {
|
||||||
openHandle(id) {
|
openHandle(id) {
|
||||||
const index = this._getSectionIndex(id);
|
const index = this._getSectionIndex(id);
|
||||||
//log(`openHandle resolved ${id} to ${index}`);
|
//log(`openHandle resolved ${id} to ${index}`);
|
||||||
return new Handle(this, index);
|
return new Handle(this, index, this._originalHeights[index]);
|
||||||
}
|
}
|
||||||
|
|
||||||
_getAvailableHeight() {
|
_getAvailableHeight() {
|
||||||
|
@ -258,13 +258,14 @@ export class Layout {
|
||||||
}
|
}
|
||||||
|
|
||||||
class Handle {
|
class Handle {
|
||||||
constructor(layout, anchor) {
|
constructor(layout, anchor, height) {
|
||||||
this._layout = layout;
|
this._layout = layout;
|
||||||
this._anchor = anchor;
|
this._anchor = anchor;
|
||||||
|
this._initialHeight = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
setOffset(offset) {
|
setHeight(height) {
|
||||||
this._layout._relayout(this._anchor, offset);
|
this._layout._relayout(this._anchor, height - this._initialHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
finish() {
|
finish() {
|
||||||
|
@ -283,7 +284,7 @@ export class Distributor extends FixedDistributor {
|
||||||
this._handle.finish();
|
this._handle.finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
resize(offset) {
|
resize(height) {
|
||||||
this._handle.setOffset(offset);
|
this._handle.setHeight(height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue