Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete Vertical Lanes #2082

Merged
merged 3 commits into from
Jan 22, 2024
Merged

Delete Vertical Lanes #2082

merged 3 commits into from
Jan 22, 2024

Conversation

sombrek
Copy link
Contributor

@sombrek sombrek commented Jan 21, 2024

Closes #2081

This is a small independent fix.

@sombrek
Copy link
Contributor Author

sombrek commented Jan 21, 2024

It seems there is some kind of rounding issue when deleting lanes that causes their boundaries to mismatch. This affects both horizontal and vertical lanes. This can probably be fixed in the future.

delete-off

@barmac
Copy link
Member

barmac commented Jan 22, 2024

It seems there is some kind of rounding issue when deleting lanes that causes their boundaries to mismatch. This affects both horizontal and vertical lanes. This can probably be fixed in the future.

Could you please share a diagram in which you got this result? I cannot reproduce it on my own.

@sombrek
Copy link
Contributor Author

sombrek commented Jan 22, 2024

Could you please share a diagram in which you got this result? I cannot reproduce it on my own.

Sure, it's test/spec/features/modeling/lanes/lanes.bpmn
Open it via bpmn.io then delete lane c and lane b.

I cannot reproduce it with a newly created pool. Maybe it's because of the odd dimensions in that model.

@barmac
Copy link
Member

barmac commented Jan 22, 2024

Thank you! I can reproduce it now. We should make sure that the child lanes don't exceed the parent lane bounds.

@barmac
Copy link
Member

barmac commented Jan 22, 2024

I moved this to a separate issue as it's not required for this PR: #2083

Comment on lines 153 to 155
var isHorizontalLane = isHorizontal(shape);

compensateLaneDelete(shape, oldParent, isHorizontalLane);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather move the isHorizontal call to the inside of compensateLaneDelete. There's no case where we'd pass isHorizontalLane=false for horizontal lanes to this function.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will do that as a quick change.

@barmac
Copy link
Member

barmac commented Jan 22, 2024

Thank you! I can reproduce it now. We should make sure that the child lanes don't exceed the parent lane bounds.

BTW this bug can be noticed on the vertical lanes fixture that you're adding in this PR.

@barmac
Copy link
Member

barmac commented Jan 22, 2024

There is a width missmatch in the DI:

      <bpmndi:BPMNShape id="BPMNShape_140jwaa" bpmnElement="Vertical_Participant_Lane" isHorizontal="false">
        <dc:Bounds x="160" y="50" width="603" height="540" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_0n0ckvg" bpmnElement="Vertical_Lane_B" isHorizontal="false">
        <dc:Bounds x="655" y="80" width="108" height="510" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_1xhgbhc" bpmnElement="Vertical_Lane_A" isHorizontal="false">
        <dc:Bounds x="160" y="80" width="496" height="510" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>

Notice that the child lanes' widths sum up to 604 while the parent is 603.

@barmac
Copy link
Member

barmac commented Jan 22, 2024

I will fix the widths as well.

@barmac barmac force-pushed the delete-vertical-lanes branch from a47867b to b2a8aee Compare January 22, 2024 12:02
@barmac barmac force-pushed the delete-vertical-lanes branch from b2a8aee to d306dcd Compare January 22, 2024 12:06
@barmac
Copy link
Member

barmac commented Jan 22, 2024

We will make it a fix when squashing.

@barmac
Copy link
Member

barmac commented Jan 22, 2024

Thank you @sombrek for your another great contribution!

@barmac barmac merged commit df2ae05 into bpmn-io:develop Jan 22, 2024
9 checks passed
@sombrek
Copy link
Contributor Author

sombrek commented Jan 22, 2024

Thank you @sombrek for your another great contribution!

@barmac Thank you very much for your review, support and detail work you put into my contribution. I will learn from your remarks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vertical lane removal leads to unexpected outcome
2 participants