Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot move single routing point with Manhattan routing #310

Closed
martin-fleck-at opened this issue Sep 9, 2022 · 3 comments
Closed

Cannot move single routing point with Manhattan routing #310

martin-fleck-at opened this issue Sep 9, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@martin-fleck-at
Copy link
Contributor

Investigating the bug reported in GLSP, I saw that there is a bug in the Manhattan routing that prevents moving the single routing point.

cannot-move-first-point
(it can also be reproduced with the class diagram of Sprotty)

When moving the routing handles (which are placed between two routing points or the start/end point), we want to align the calculated route with the routing points present in the edge. However, if we only have start and end point, then the routing points array of the edge is empty preventing any update.

We can avoid the problem when we simply add a routing point to the edge if we try to move the routing handle. However, it is not very clear to me which routing points would be suitable as it very much depends on the start/end position calculation of the edge. If we simply were to use the target position then we would get something like this:

fix-move-first-point

But this does not behave like we would expect as you can see if I have already an arch between source and target then I get a much nicer move.

@rsoika
Copy link

rsoika commented Oct 12, 2022

@martin-fleck-at can you show how you did realize your workaround? Currently I am trying to implement my own manhantan router and this would possible help me to understand the inner logic.
@spoenemann it's very hard for me to contribute to your project because the comments are missing from your code. Even if you understand your own implementation, it's not easy for an outsider to get into the code. Routing is generally a complex topic and missing comments do not reduce it ;-)

@martin-fleck-at
Copy link
Contributor Author

martin-fleck-at commented Oct 12, 2022

@rsoika I opened a WIP PR on GLSP to show how I did it for the second GIF you see in the bug report. The changed code is basically the if-block starting on line 33. Hopefully, this will help you with your own Manhattan router.

@dhuebner dhuebner self-assigned this Feb 8, 2023
dhuebner added a commit that referenced this issue Feb 13, 2023
…-310

Move single routing point with Manhattan #310
@dhuebner
Copy link
Contributor

Fixed in master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants