Skip to content

Commit 84c562d

Browse files
authored
Fix for grids with many columns
Updated cellWidth method to not round cellWidth value. It was causing problem for grids with larger number of columns and uneven cell width calculated. (e.g. cellWidth is calculated to be 19.5px and there are 30 columns. Further we go, larger the mistake with positioning widgets)
1 parent 57c6511 commit 84c562d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/gridstack.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1623,7 +1623,7 @@
16231623
};
16241624

16251625
GridStack.prototype.cellWidth = function() {
1626-
return Math.round(this.container.outerWidth() / this.opts.width);
1626+
return this.container.outerWidth() / this.opts.width;
16271627
};
16281628

16291629
GridStack.prototype.getCellFromPixel = function(position, useOffset) {

0 commit comments

Comments
 (0)