Skip to content

[FEAT] Ensure that the terminal waypoints are on the shape perimeter #1870

@tbouffard

Description

@tbouffard

Is your feature request related to a problem? Please describe.

When removing the 'orthogonal segments' (see #295), we have been forced to disable the projection on the shape perimeter as part of #1868.
It created side effects with the arrow depending on the zoom factor. See #1779 for more details.

Describe the solution you'd like

Having the terminal waypoints on the shape perimeter can help fixing glitches (in particular with arrows) when the BPMN source put it inside the shape. See screenshots later in the description.

Finding a way to have the terminal waypoints on the perimeter: we cannot use the standard mxgraph perimeter projection as it has side effects.
For instance, we could use the intersection of the perimeter with the existing last segment instead of doing a projection. That way, the point on the perimeter would be always aligned with the last existing segment and wouldn't create glitches with arrows like #351 (comment) (we have visual non regression test to detect such problems and fixes)

Additional context

On this topic, bpmn-js manages inside terminal waypoints by always putting the shape on top of the edge and use opacity with the shape fill color. mxGraph provides a way to always put shapes on top of edges
See the documentation about keepEdgesInBackground and keepEdgesInForeground.

Screenshots

Compare no projection and projection on the shape perimeter. In the following, the projection is done by creating a segment between the last point and the center of the shape, then by selecting the intersection of this segment with the shape perimeter. It is also possible to do a orthogonal projection of the last of point of the segment on the shape perimeter (via a style property - its name contains the 'orthogonal' word).

use case no projection with projection
Associations (outside) no_projection_associations and annotations 03 waypoints 02 outside shape-snap projection_associations and annotations 03 waypoints 02 outside shape-snap
Message flow (outside) no_projection_flows message 03 waypoints 03 outside-snap projection_flows message 03 waypoints 03 outside-snap
Message flow (inside) no_projection_flows message 03 waypoints 02 inside-snap projection_flows message 03 waypoints 02 inside-snap
Sequence flow (outside) no_projection_flows sequence 04 waypoints 03 terminal outside shapes 01 general-snap projection_flows sequence 04 waypoints 03 terminal outside shapes 01 general-snap
Sequence flow (inside) no_projection_flows sequence 04 waypoints 02 terminal inside shapes-snap projection_flows sequence 04 waypoints 02 terminal inside shapes-snap

Metadata

Metadata

Assignees

No one assigned

    Labels

    BPMN renderingSomething about the way the lib is rendering BPMN elementsenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions