Community
Participate
Working Groups
Created attachment 269213 [details] Patch to trigger the bug in the MVC Logo example This bug was discovered in the GEF logo example with the modifications from the attached patch. Steps to reproduce: 1. Hover over one of the square shapes 2. Click and drag the plus sign Expected: A connection is created and the connection endpoint is following the mouse when dragging. Actual: A connection is created but the connection endpoint does not follow the mouse and an exception is thrown. See the attached gif for a demonstration.
Created attachment 269214 [details] a demonstration of the bug
This seems to happen because there is a mismatch between handle parts and anchors for the connection. At the end of BendFirstAnchorageOnSegmentHandleDragHandler#prepareBend a connectionIndex is retrieved from the host handle part and used to check whether the anchor at that index is explicit. Since the handle parts are created similar to this: O---#----#----#---+ | # | # | # | +---#---#---#---O And we are dragging the end point which is at segment index 2, but the anchors on the connection looks something like this: A | | | | | A--------------------------------A We get an exception since there is no segment with index two when looking at the anchors. I am attaching a patch that fixes the problem by updating handles before calling prepareBend. Not sure if this is the wanted solution since it feels like it only addresses the symptom and not the cause.
Created attachment 269215 [details] Solution to the bug