* Check if two grid positions are touching (edges or corners). * * @param a first position * @param b second position * @returns true if the positions are touching * * @example * const touching = Utils.isTouching( * {x: 0, y: 0, w: 2, h: 1}, * {x: 2, y: 0, w: 1, h: 1}
(a: GridStackPosition, b: GridStackPosition)
| 259 | * ); // true - they share an edge |
| 260 | */ |
| 261 | static isTouching(a: GridStackPosition, b: GridStackPosition): boolean { |
| 262 | return Utils.isIntercepted(a, {x: b.x-0.5, y: b.y-0.5, w: b.w+1, h: b.h+1}) |
| 263 | } |
| 264 | |
| 265 | /** |
| 266 | * Calculate the overlapping area between two grid positions. |
no test coverage detected