theia-ide / sprotty

A next-gen web-based graphics framework
Apache License 2.0
138 stars 23 forks source link

Implemented removal of edge routing points #210

Closed spoenemann closed 6 years ago

spoenemann commented 6 years ago

Fixes #206. Drag a routing point so it forms an almost straight line with its preceding and following points to remove it.

The idea: When the mouse button is pressed down on a routing handle, a new editMode flag is set on it using SwitchEditModeAction, and the flag is removed when the button is released. The check for the angle between neighboring points is done for handles that are in edit mode. When the editMode is switched off and the selected routing point is currently skipped, it is removed.

I also removed the check for the distance of neighboring points in the linear router since that was rather confusing while editing the routing. The check is still active for the source and target anchor.