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

Method isAreaEmpty

src/gridstack-engine.ts:366–369  ·  view source on GitHub ↗

* Check if the specified rectangular area is empty (no nodes occupy any part of it). * * @param x the x coordinate (column) of the area to check * @param y the y coordinate (row) of the area to check * @param w the width in columns of the area to check * @param h the height in rows of

(x: number, y: number, w: number, h: number)

Source from the content-addressed store, hash-verified

364 * }
365 */
366 public isAreaEmpty(x: number, y: number, w: number, h: number): boolean {
367 const nn: GridStackNode = {x: x || 0, y: y || 0, w: w || 1, h: h || 1};
368 return !this.collide(nn);
369 }
370
371 /**
372 * Re-layout grid items to reclaim any empty space.

Callers

nothing calls this directly

Calls 1

collideMethod · 0.95

Tested by

no test coverage detected