From ff289b3319a0938821f77d4a0b53aa58208418b2 Mon Sep 17 00:00:00 2001 From: Abdul Ahad Date: Mon, 12 Aug 2024 15:03:39 +0200 Subject: [PATCH] fix: lane resize constraint for se and nw correct Closes #2209 --- lib/features/modeling/behavior/ResizeBehavior.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/features/modeling/behavior/ResizeBehavior.js b/lib/features/modeling/behavior/ResizeBehavior.js index 6143f8099d..a1df8c74ba 100644 --- a/lib/features/modeling/behavior/ResizeBehavior.js +++ b/lib/features/modeling/behavior/ResizeBehavior.js @@ -164,6 +164,9 @@ export function getParticipantResizeConstraints(laneShape, resizeDirection, bala if (isHorizontalLane && otherTrbl.top < (laneTrbl.top - 10)) { isFirst = false; } + if (isHorizontalLane && otherTrbl.bottom > (laneTrbl.bottom + 10)) { + isLast = false; + } // max top size (based on next element) if (balanced && abs(laneTrbl.top - otherTrbl.bottom) < 10) { @@ -198,6 +201,9 @@ export function getParticipantResizeConstraints(laneShape, resizeDirection, bala if (isHorizontalLane && otherTrbl.bottom > (laneTrbl.bottom + 10)) { isLast = false; } + if (isHorizontalLane && otherTrbl.top < (laneTrbl.top - 10)) { + isFirst = false; + } // max bottom size (based on previous element) if (balanced && abs(laneTrbl.bottom - otherTrbl.top) < 10) { @@ -243,7 +249,7 @@ export function getParticipantResizeConstraints(laneShape, resizeDirection, bala addMin(minTrbl, 'top', flowElementTrbl.top - padding.top); } - if (isLast && /e/.test(resizeDirection)) { + if (/e/.test(resizeDirection)) { addMax(minTrbl, 'right', flowElementTrbl.right + padding.right); } @@ -251,7 +257,7 @@ export function getParticipantResizeConstraints(laneShape, resizeDirection, bala addMax(minTrbl, 'bottom', flowElementTrbl.bottom + padding.bottom); } - if (isFirst && /w/.test(resizeDirection)) { + if (/w/.test(resizeDirection)) { addMin(minTrbl, 'left', flowElementTrbl.left - padding.left); } });