MCPcopy
hub / github.com/react-grid-layout/react-grid-layout / hasOverlaps

Function hasOverlaps

test/spec/fast-compactor-test.js:68–79  ·  view source on GitHub ↗
(layout)

Source from the content-addressed store, hash-verified

66
67// Check if a layout has any overlaps (ignoring static items overlapping each other)
68function hasOverlaps(layout) {
69 for (let i = 0; i < layout.length; i++) {
70 for (let j = i + 1; j < layout.length; j++) {
71 if (collides(layout[i], layout[j])) {
72 // Allow static items to overlap with each other
73 if (layout[i].static && layout[j].static) continue;
74 return true;
75 }
76 }
77 }
78 return false;
79}
80
81// Measure execution time
82function measureTime(fn, iterations = 100) {

Callers 1

Calls 1

collidesFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…