Files
ztab/app/src/vendor/muuri-src/utils/isOverlapping.js
yinsx bf5a3bc343 1
2026-02-02 09:07:30 +08:00

22 lines
454 B
JavaScript

/**
* Copyright (c) 2015-present, Haltu Oy
* Released under the MIT license
* https://github.com/haltu/muuri/blob/master/LICENSE.md
*/
/**
* Check if two rectangles are overlapping.
*
* @param {Object} a
* @param {Object} b
* @returns {Number}
*/
export default function isOverlapping(a, b) {
return !(
a.left + a.width <= b.left ||
b.left + b.width <= a.left ||
a.top + a.height <= b.top ||
b.top + b.height <= a.top
);
}