ch-lukas opened a new pull request, #3652:
URL: https://github.com/apache/incubator-kie-tools/pull/3652

   Closes: 
[kie-issues#2369](https://github.com/apache/incubator-kie-issues/issues/2369)
   
   Moving a node in the BPMN editor doesn't recalculate where its sequence 
flows connect, so the line often ends up meeting the shape at an odd spot 
(usually a corner of the bounding box) rather than the side facing the other 
node. It's most obvious on events, since they're circles and the connection 
clearly lands off-centre.
   
   The fix picks the anchor from where the connected node sits relative to this 
one (left, right, above or below) and attaches to the middle of that side. 
That's the same dominant-axis logic the auto-positioned edges already use, so I 
reused it instead of writing a second copy.
   
   On a move it only re-picks the side when the node actually crosses into a 
different zone. So if you've dragged an anchor onto a particular side and then 
nudge the node a little, it stays where you put it; move it far enough that 
it's now on a different side of the target and it snaps across. It covers all 
node types, and because the side midpoints fall on an event's circle it lines 
up on events too.
   
   Roughly where the changes are:
   
   - `xyflow-react-kie-diagram`: the auto-anchored (Center) end uses a small 
`getBorderMidpointTowards` helper that wraps the existing 
`getPositionalHandlePosition`.
   - `bpmn-editor` `repositionNode`: on a move it compares the node's zone 
before and after, and if it changed, resets that endpoint back to the node 
centre (which renders as auto) instead of dragging it along.
   
   To try it:
   
   1. Connect an event to a task and move the event below, above and beside it.
   2. Drag an endpoint to pin it, nudge the node a bit (should stay), then move 
it to another side (should re-optimise).
   
   Happy to take feedback on the zone rule and how the pinned-anchor behaviour 
feels.
   
   - [x] Linked to a GitHub issue
   - [x] `pnpm bootstrap` run (formatting + lockfile)
   - [ ] `pnpm -F @kie-tools/bpmn-editor... build:prod` passes
   - [ ] Tests pass (unit + E2E)
   - [x] License headers on new files (n/a, no new files)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to