1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-20 16:22:28 +03:00

Condense isInRect

This commit is contained in:
J. Ryan Stinnett
2019-06-25 11:57:55 +01:00
parent 72bfc3b5ea
commit 67130cb45f

View File

@@ -35,16 +35,8 @@ function getOrCreateContainer() {
function isInRect(x, y, rect, buffer = 10) { function isInRect(x, y, rect, buffer = 10) {
const { top, right, bottom, left } = rect; const { top, right, bottom, left } = rect;
return x >= (left - buffer) && x <= (right + buffer)
if (x < (left - buffer) || x > (right + buffer)) { && y >= (top - buffer) && y <= (bottom + buffer);
return false;
}
if (y < (top - buffer) || y > (bottom + buffer)) {
return false;
}
return true;
} }
/* /*