* Check if two grid positions overlap/intersect. * * @param a first position with x, y, w, h properties * @param b second position with x, y, w, h properties * @returns true if the positions overlap * * @example * const overlaps = Utils.isIntercepted( * {x: 0, y: 0, w: 2, h
(a: GridStackPosition, b: GridStackPosition)
| 242 | * ); // true - they overlap |
| 243 | */ |
| 244 | static isIntercepted(a: GridStackPosition, b: GridStackPosition): boolean { |
| 245 | return !(a.y >= b.y + b.h || a.y + a.h <= b.y || a.x + a.w <= b.x || a.x >= b.x + b.w); |
| 246 | } |
| 247 | |
| 248 | /** |
| 249 | * Check if two grid positions are touching (edges or corners). |
no outgoing calls
no test coverage detected