From 3fae5ded98f5c32d4a3cae4bee1acf04f2832abc Mon Sep 17 00:00:00 2001 From: Sajal Garg Date: Tue, 18 Feb 2025 18:16:58 +0530 Subject: [PATCH 1/2] Updated Get Rect Stack --- lib/commons/dom/get-rect-stack.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/commons/dom/get-rect-stack.js b/lib/commons/dom/get-rect-stack.js index 36489a50..c6127942 100644 --- a/lib/commons/dom/get-rect-stack.js +++ b/lib/commons/dom/get-rect-stack.js @@ -10,8 +10,8 @@ export function getRectStack( x = null, y = null ) { - const center = getRectCenter(rect); - const gridCell = grid.getCellFromPoint(center) || []; + let center = getRectCenter(rect); + let gridCell = grid.getCellFromPoint(center) || []; let floorX = Math.floor(center.x); let floorY = Math.floor(center.y); @@ -20,6 +20,9 @@ export function getRectStack( if (isCoordsPassed) { floorX = Math.floor(x); floorY = Math.floor(y); + + center = new window.DOMPoint(x, y); + gridCell = grid.getCellFromPoint(center) || []; } let stack = gridCell.filter(gridCellNode => { From 97d82748f2e27ba5a21704d978e03e7754a72d89 Mon Sep 17 00:00:00 2001 From: sajalg-bstack Date: Tue, 18 Feb 2025 19:38:58 +0530 Subject: [PATCH 2/2] Update get-rect-stack.js --- lib/commons/dom/get-rect-stack.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/commons/dom/get-rect-stack.js b/lib/commons/dom/get-rect-stack.js index c6127942..83bb320e 100644 --- a/lib/commons/dom/get-rect-stack.js +++ b/lib/commons/dom/get-rect-stack.js @@ -21,7 +21,7 @@ export function getRectStack( floorX = Math.floor(x); floorY = Math.floor(y); - center = new window.DOMPoint(x, y); + center = new window.DOMPoint(floorX, floorY); gridCell = grid.getCellFromPoint(center) || []; }