Skip to content

Commit 3fae5de

Browse files
committed
Updated Get Rect Stack
1 parent d0c356b commit 3fae5de

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/commons/dom/get-rect-stack.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ export function getRectStack(
1010
x = null,
1111
y = null
1212
) {
13-
const center = getRectCenter(rect);
14-
const gridCell = grid.getCellFromPoint(center) || [];
13+
let center = getRectCenter(rect);
14+
let gridCell = grid.getCellFromPoint(center) || [];
1515

1616
let floorX = Math.floor(center.x);
1717
let floorY = Math.floor(center.y);
@@ -20,6 +20,9 @@ export function getRectStack(
2020
if (isCoordsPassed) {
2121
floorX = Math.floor(x);
2222
floorY = Math.floor(y);
23+
24+
center = new window.DOMPoint(x, y);
25+
gridCell = grid.getCellFromPoint(center) || [];
2326
}
2427

2528
let stack = gridCell.filter(gridCellNode => {

0 commit comments

Comments
 (0)