floor default section height

pull/21833/head
Bruno Windels 2019-01-28 16:29:34 +01:00
parent 6e55ebdab7
commit d833174d68
1 changed files with 2 additions and 1 deletions

View File

@ -81,10 +81,11 @@ export class Layout {
this._sections = sections; this._sections = sections;
const totalHeight = this._getAvailableHeight(); const totalHeight = this._getAvailableHeight();
const defaultHeight = Math.floor(totalHeight / this._sections.length);
this._sections.forEach((section, i) => { this._sections.forEach((section, i) => {
if (!this._sectionHeights[section.id]) { if (!this._sectionHeights[section.id]) {
this._sectionHeights[section.id] = clamp( this._sectionHeights[section.id] = clamp(
totalHeight / this._sections.length, defaultHeight,
this._getMinHeight(i), this._getMinHeight(i),
this._getMaxHeight(i), this._getMaxHeight(i),
); );