Skip to content

Commit f7bfd11

Browse files
authored
fix: no-overlap layout algorithm (#2239)
Corrects issue with no-overlap layout #2240
1 parent d3e6c9d commit f7bfd11

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/utils/layout-algorithms/no-overlap.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,11 @@ export default function ({
5050
const y3 = se2.style.top
5151
const y4 = se2.style.top + se2.style.height
5252

53-
// be friends when overlapped
54-
if ((y3 <= y1 && y1 <= y4) || (y1 <= y3 && y3 <= y2)) {
53+
if (
54+
(y3 >= y1 && y4 <= y2) ||
55+
(y4 > y1 && y4 <= y2) ||
56+
(y3 >= y1 && y3 < y2)
57+
) {
5558
// TODO : hashmap would be effective for performance
5659
se1.friends.push(se2)
5760
se2.friends.push(se1)

0 commit comments

Comments
 (0)