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

[BUG] Message/Sequence Flow start and end points are sometimes not at the right position #994

Closed
tbouffard opened this issue Dec 29, 2020 · 4 comments · Fixed by #1868
Closed
Labels
BPMN rendering Something about the way the lib is rendering BPMN elements bug Something isn't working
Milestone

Comments

@tbouffard
Copy link
Member

tbouffard commented Dec 29, 2020

Describe the bug
See what is expected (bpmn-js) and what we have with [email protected]

With the non regression visual tests BPMN diagram flows.message.01.icons.bpmn - on the message flows on the left of the diagram.

message_flow_wrong_position

With the non regression visual tests BPMN diagram flows.message.02.labels.and.complex.paths.bpmn, we see that the zoom/scale factor (in the following, when clicking on 'Fit View') changes to position of the message flows
Notice that we also see issues

wrong_position_and_arrow_issue

This also occurs with sequence flows, see rendering of C.6.0, the first (from the top) outgoing sequence flow from the Make Booking subprocess

Expected (from the miwg-test-suite reference png) What bpmn-visualization displays
C 6 0 image

To Reproduce
Independent of the OS and the Browser.
The bpmn-js comparison example can be used to check the behaviour discrepancies.

Additional context
We have detected this issue on message flows from day 1, see #394.
The root cause may be the same as in #715: scaling computation issue.

@tbouffard tbouffard added bug Something isn't working BPMN rendering Something about the way the lib is rendering BPMN elements labels Dec 29, 2020
@tbouffard tbouffard added this to the BPMN rendering improvements milestone Dec 29, 2020
@tbouffard tbouffard changed the title [BUG] Message Flow start and end points are sometimes not at the right position [BUG] Message/Sequence Flow start and end points are sometimes not at the right position Dec 29, 2020
@tbouffard
Copy link
Member Author

tbouffard commented Jan 13, 2021

The following animation done by loading the non regression visual tests BPMN diagram flows.message.01.icons.bpmn with [email protected] show that depending on the zoom/scale factor, the message flow on the left of the diagram is sometime displayed at the right or wrong position.
This can be reproduced in demo and test page of this repository, using Fit on load (whatever value it is) or no fit, the behaviour is the same.

flows message 01 icons bpmn_zoom

This can also be reproduced with a simplified version of the test diagram (flows.message.01.icons_simplifiied.bpmn.txt) that only contains the fewest elements, showing that the rest of the diagram has no influence here.
The BPMN elements are perfectly correct (see the simplified diagram file content for instance).

flows message 01 icons bpmn_simplified_zoom

@tbouffard
Copy link
Member Author

tbouffard commented Mar 31, 2021

Question: could this be related to what is described in jgraph/drawio#1872

Fix for segment connector routing differently at different zoom levels. The code section checked for result points being inside the source and targets, which have a non-trivial area for floating ports. The points in the results array are not scaled, the target and source being used were scaled, so contains was incorrect at specific zooms and removed points.

Seems fixed in jgraph/drawio@91c8890
Let's check if the SegmentConnector is involved here: https://github.com/jgraph/mxgraph/blob/v4.2.2/javascript/src/js/view/mxEdgeStyle.js#L592, if so the mxgraph change is located somewhere after jgraph/drawio@91c8890#diff-407d955a2d2bc1b027fb92faf205a498090549c93ee3b99274b3851cd0096d70R950

@tbouffard
Copy link
Member Author

New changes in draw.io

https://github.com/jgraph/drawio/blob/v14.7.3/ChangeLog
29-MAY-2021: 14.7.3
Fixes rounding errors in segment connector [2257]
jgraph/drawio@82f74a0#diff-407d955a2d2bc1b027fb92faf205a498090549c93ee3b99274b3851cd0096d70

@tbouffard
Copy link
Member Author

tbouffard commented Jun 14, 2021

Root cause: when using segment connector (that produces orthogonal segments, #295), depending on the zoom level (i.e the mxgraph scale values), some points on the edge definitions are wrongly removed.

fix attempt based on draw.io reverse engineering: poc #1363

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BPMN rendering Something about the way the lib is rendering BPMN elements bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant