Skip to content

Commit 6c7f7e4

Browse files
authored
Merge pull request #1300 from adumesny/typescript
TS: more fix for #810 many columns roundoff error
2 parents e25a00c + a7eadf4 commit 6c7f7e4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/gridstack.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ export class GridStack {
233233
this._isAutoCellHeight = (this.opts.cellHeight === 'auto');
234234
if (this._isAutoCellHeight) {
235235
// make the cell square initially
236-
this.cellHeight(this.cellWidth(), true);
236+
this.cellHeight(Math.round(this.cellWidth()), true);
237237
} else {
238238
this.cellHeight(this.opts.cellHeight, true);
239239
}
@@ -1500,7 +1500,7 @@ export class GridStack {
15001500
*/
15011501
private _onResizeHandler(): GridStack {
15021502
if (this._isAutoCellHeight) {
1503-
Utils.throttle(() => { this.cellHeight(this.cellWidth(), false)}, 100);
1503+
Utils.throttle(() => { this.cellHeight(Math.round(this.cellWidth()), false)}, 100);
15041504
}
15051505

15061506
if (!this.opts.disableOneColumnMode && this.el.clientWidth <= this.opts.minWidth) {

0 commit comments

Comments
 (0)