diff --git a/app/client/src/utils/boxHelpers.ts b/app/client/src/utils/boxHelpers.ts index 5ade38372de3..a74acf72ff08 100644 --- a/app/client/src/utils/boxHelpers.ts +++ b/app/client/src/utils/boxHelpers.ts @@ -5,11 +5,8 @@ export interface Rect { bottom: number; } -export const areIntersecting = (r1: Rect, r2: Rect) => { - return !( - r2.left >= r1.right || - r2.right <= r1.left || - r2.top >= r1.bottom || - r2.bottom <= r1.top - ); -}; +export const areIntersecting = (r1: Rect, r2: Rect) => + r2.left < r1.right && + r2.right > r1.left && + r2.top < r1.bottom && + r2.bottom > r1.top;