From 50ce2ee123a5c746cd00f0e01a0ad26624cb23de Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Tue, 8 Jun 2021 23:53:27 +1000 Subject: [PATCH] Remove tile global position collision work around --- src/contexts/TileDragContext.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/contexts/TileDragContext.js b/src/contexts/TileDragContext.js index 767a213..ab9106c 100644 --- a/src/contexts/TileDragContext.js +++ b/src/contexts/TileDragContext.js @@ -141,11 +141,9 @@ export function TileDragProvider({ onDragAdd, children }) { } function customCollisionDetection(rects, rect) { - // Calculate rect bottom taking into account any scroll offset - const rectBottom = rect.top + rect.bottom - rect.offsetTop; const rectCenter = { x: rect.left + rect.width / 2, - y: rectBottom - rect.height / 2, + y: rect.top + rect.height / 2, }; // Find whether out rect center is outside our add to map rect