tesis-dynaware / graph-editor

Eclipse Public License 1.0
132 stars 42 forks source link

Add Autoscrolling while dragging #16

Closed eckig closed 9 years ago

eckig commented 9 years ago

It would be very nice to provide an autoscrolling feature while dragging in large graphs.

Example: Node A is on the very left of the graph and Node B on the very right. If you now want to create a connection, you would have to move them closer to each other until both of them are in the screen.

Which is not very user friendly :-)

rmfisher commented 9 years ago

You can drag Node A's connector to the right, then, while still holding down the left mouse button, click-and-drag with the right-mouse button to pan to the right. Your 'tail' state should survive the panning. I just tried this and it works at least. Dragging nodes and selections around while panning does not work as cleanly though, they jump to another position when you release the right-mouse after panning.

But you are right, such an autoscrolling feature would be very nice :)

rmfisher commented 9 years ago

I pushed a small fix so that if you drag a node with the left-mouse button, pan with the right mouse button while still holding down the left mouse button, then continue dragging again with the left mouse button, the node should continue to move correctly and not jump. If you'd like to test it out that would be great.

As for autoscrolling, I will take a look further into this but it may not be trivial to implement cleanly.

eckig commented 9 years ago

Yeah, I discovered this quick fix (panning with right mouse button) too.. But as you said: It is not optimal ;-)

rmfisher commented 9 years ago

I've been trying out a solution for this and it looks fairly promising. I hope to integrate it in the near future.

eckig commented 9 years ago

Wow, that is very nice to hear! Thanks in advance :-)

rmfisher commented 9 years ago

I added this mechanism, but I'm not completely happy with how it feels yet. I might tweak how the scroll-speed is determined in the future. Let me know how you find it.

eckig commented 9 years ago

Looks quite nice, I will test this with our production code on Monday.

And the scrolling feels quite natural, at the moment nothing to complain.

PS: You again deleted the last version tags ;-)

rmfisher commented 9 years ago

Ah I see what you mean. Well I prefer to clean up the old tags but I'm trying to add more text describing any significant changes.

eckig commented 9 years ago

Just tested it with our application and it works perfectly, thank you very much!