Bug 519226 - Creating a connection with orthogonal routing style throws exception in the logo example
Summary: Creating a connection with orthogonal routing style throws exception in the l...
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF MVC (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: greatbug
Depends on:
Blocks:
 
Reported: 2017-07-05 07:53 EDT by Victor Johnsson CLA
Modified: 2018-10-15 14:15 EDT (History)
1 user (show)

See Also:


Attachments
Patch to trigger the bug in the MVC Logo example (2.32 KB, application/octet-stream)
2017-07-05 07:53 EDT, Victor Johnsson CLA
no flags Details
a demonstration of the bug (224.63 KB, image/gif)
2017-07-05 07:54 EDT, Victor Johnsson CLA
no flags Details
Solution to the bug (3.89 KB, patch)
2017-07-05 08:11 EDT, Victor Johnsson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Johnsson CLA 2017-07-05 07:53:18 EDT
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.
Comment 1 Victor Johnsson CLA 2017-07-05 07:54:42 EDT
Created attachment 269214 [details]
a demonstration of the bug
Comment 2 Victor Johnsson CLA 2017-07-05 08:10:28 EDT
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.
Comment 3 Victor Johnsson CLA 2017-07-05 08:11:25 EDT
Created attachment 269215 [details]
Solution to the bug