From a7eadf4db2f41a81e87ac9722340f08f2b6c8f18 Mon Sep 17 00:00:00 2001 From: Alain Dumesny Date: Sun, 5 Jul 2020 11:53:24 -0700 Subject: [PATCH] TS: more fix for #810 many columns roundoff error --- src/gridstack.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gridstack.ts b/src/gridstack.ts index 474f573ed..24a7c7310 100644 --- a/src/gridstack.ts +++ b/src/gridstack.ts @@ -233,7 +233,7 @@ export class GridStack { this._isAutoCellHeight = (this.opts.cellHeight === 'auto'); if (this._isAutoCellHeight) { // make the cell square initially - this.cellHeight(this.cellWidth(), true); + this.cellHeight(Math.round(this.cellWidth()), true); } else { this.cellHeight(this.opts.cellHeight, true); } @@ -1500,7 +1500,7 @@ export class GridStack { */ private _onResizeHandler(): GridStack { if (this._isAutoCellHeight) { - Utils.throttle(() => { this.cellHeight(this.cellWidth(), false)}, 100); + Utils.throttle(() => { this.cellHeight(Math.round(this.cellWidth()), false)}, 100); } if (!this.opts.disableOneColumnMode && this.el.clientWidth <= this.opts.minWidth) {