MCPcopy Index your code
hub / github.com/gridstack/gridstack.js / isIntercepted

Method isIntercepted

src/utils.ts:244–246  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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).

Callers 5

collideMethod · 0.80
collideAllMethod · 0.80
findEmptyPositionMethod · 0.80
isTouchingMethod · 0.80
utils-spec.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected