Remove tile global position collision work around

This commit is contained in:
Mitchell McCaffrey 2021-06-08 23:53:27 +10:00
parent 57cce9346d
commit 50ce2ee123

View File

@ -141,11 +141,9 @@ export function TileDragProvider({ onDragAdd, children }) {
} }
function customCollisionDetection(rects, rect) { function customCollisionDetection(rects, rect) {
// Calculate rect bottom taking into account any scroll offset
const rectBottom = rect.top + rect.bottom - rect.offsetTop;
const rectCenter = { const rectCenter = {
x: rect.left + rect.width / 2, 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 // Find whether out rect center is outside our add to map rect