From f7bfd11f6ce475dd4390e8ed0bf0efea0f1c0a69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20B=C4=85k?= <74078701+lukbak@users.noreply.github.com> Date: Tue, 10 Jan 2023 13:50:55 +0100 Subject: [PATCH] fix: no-overlap layout algorithm (#2239) Corrects issue with no-overlap layout #2240 --- src/utils/layout-algorithms/no-overlap.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/utils/layout-algorithms/no-overlap.js b/src/utils/layout-algorithms/no-overlap.js index 8738f26bf..0d68ec52f 100644 --- a/src/utils/layout-algorithms/no-overlap.js +++ b/src/utils/layout-algorithms/no-overlap.js @@ -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)