Skip to content

Commit

Permalink
fix: lane resize constraint for se and nw correct
Browse files Browse the repository at this point in the history
Closes #2209
  • Loading branch information
abdul99ahad committed Aug 13, 2024
1 parent 8511c2a commit ff289b3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/features/modeling/behavior/ResizeBehavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -243,15 +249,15 @@ 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);
}

if (isLast && /s/.test(resizeDirection)) {
addMax(minTrbl, 'bottom', flowElementTrbl.bottom + padding.bottom);
}

if (isFirst && /w/.test(resizeDirection)) {
if (/w/.test(resizeDirection)) {
addMin(minTrbl, 'left', flowElementTrbl.left - padding.left);
}
});
Expand Down

0 comments on commit ff289b3

Please sign in to comment.