Skip to content

Commit 9962aa0

Browse files
committed
fix: Use rounding again for cell size
Fixes #347
1 parent 4f31aba commit 9962aa0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

projects/angular2gridster/src/lib/gridster.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,8 @@ export class GridsterService {
456456
height: parseInt(item.$element.style.height, 10) - 1
457457
};
458458

459-
let colSize = itemSize.width / this.cellWidth;
460-
let rowSize = itemSize.height / this.cellHeight;
459+
let colSize = Math.round(itemSize.width / this.cellWidth);
460+
let rowSize = Math.round(itemSize.height / this.cellHeight);
461461

462462
// Keep item minimum 1
463463
colSize = Math.max(colSize, 1);

0 commit comments

Comments
 (0)