Skip to content

Commit

Permalink
fix: no-overlap layout algorithm (jquense#2239)
Browse files Browse the repository at this point in the history
Corrects issue with no-overlap layout

jquense#2240
  • Loading branch information
lukbak authored Jan 10, 2023
1 parent d3e6c9d commit f7bfd11
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/utils/layout-algorithms/no-overlap.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ export default function ({
const y3 = se2.style.top
const y4 = se2.style.top + se2.style.height

// be friends when overlapped
if ((y3 <= y1 && y1 <= y4) || (y1 <= y3 && y3 <= y2)) {
if (
(y3 >= y1 && y4 <= y2) ||
(y4 > y1 && y4 <= y2) ||
(y3 >= y1 && y3 < y2)
) {
// TODO : hashmap would be effective for performance
se1.friends.push(se2)
se2.friends.push(se1)
Expand Down

0 comments on commit f7bfd11

Please sign in to comment.