Bug 518228 - Undo of creation of waypoints does not restore selection handles
Summary: Undo of creation of waypoints does not restore selection handles
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF MVC (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-14 05:51 EDT by Victor Johnsson CLA
Modified: 2017-06-14 11:12 EDT (History)
1 user (show)

See Also:


Attachments
How to reproduce the bug (242.79 KB, image/gif)
2017-06-14 05:51 EDT, Victor Johnsson CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Johnsson CLA 2017-06-14 05:51:24 EDT
Created attachment 268901 [details]
How to reproduce the bug

This bug was reproduced in the GEF logo example integration release 5.0.0.201706100201.

Steps to reproduce:
1. Create new waypoint for some connection by dragging a white bend point.
2. Undo action

Expected: The visual bend points are restored.
Actual: The end visual bend point has disappeared.
Comment 1 Matthias Wienand CLA 2017-06-14 11:12:39 EDT
It is important to clarify the terminology of "bend points" and "handles": content and visual bend points represent (connected or unconnected) way points of an IBendableContentPart or its visual, respectively. Within the GEF Logo Example, circular handles are generated for all bend points when a GeometricCurvePart is selected. The handles can be used to manipulate the underlying bend points.

In this case, the bend point is correctly restored. Only the handle that can be used to manipulate that bend point is not restored. I changed the title accordingly.

Updating of (selection) handles during interaction is done via SelectionBehavior#updateHandles(). This call is not performed when undoing the operation. Hence, the handles are not up-to-date after undo.

Probably, the SelectionBehavior should be able to identify that an update is necessary and perform it automatically.

As a fix will not be released until Oxygen.1 (although most certainly published way earlier on the master branch), the following workaround can be used in the interim: you can construct a ForwardUndoCompositeOperation that wraps a BendVisualOperation, as well as a special operation for updating the handles, so that they are updated after every execution/undo of the visual bend points.