From 84c562df6fd3edd66f1bb519ee89f72d6a87cf2b Mon Sep 17 00:00:00 2001 From: nulen Date: Wed, 25 Oct 2017 12:06:15 +0200 Subject: [PATCH] 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) --- src/gridstack.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gridstack.js b/src/gridstack.js index 518942def..30139295c 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -1623,7 +1623,7 @@ }; GridStack.prototype.cellWidth = function() { - return Math.round(this.container.outerWidth() / this.opts.width); + return this.container.outerWidth() / this.opts.width; }; GridStack.prototype.getCellFromPixel = function(position, useOffset) {