microsoft / automatic-graph-layout

A set of tools for graph layout and viewing
Other
1.35k stars 304 forks source link

Zoom and pan programatically? #227

Open drcogent opened 4 years ago

drcogent commented 4 years ago

I need to be able to store the the state of the graph after a user has panned and zoomed in or out, but I'm not sure how to accomplish this? I thought if I stored the ZoomF value and then applied it when trying to render it again would do the trick at least for the Zoom part, but that didn't appear to work for me.

I'm not sure how to track how the image has been panned either or restore it either.

Any help would be greatly appreciated.

drcogent commented 4 years ago

I figured out my ZoomF issue. That works now. I had to fix it so it was being set on the right thread using a delegate. Now all I have to solve is the pan issue.

rurounijones commented 3 years ago

Could you post how you did the zoom? Currently every time I edit and render the graph it zooms out again to fit the graph in the display which makes things tiny and forces lots of mouse wheeling to zoom in again.

I am using WPF and it looks like this may be my downfall since I cannot find anything there.