I am using the scrollToFit
to zoom out of the view and fit the whole diagram.
Here is the exact code I call:
diagram.commandHandler.zoomToFit();
diagram.alignDocument(go.Spot.Center, go.Spot.Center);
I think it is working quite good, only problem I see is that it is not taking the scrollMargin
set to 100
into account because I would expect it to zoom a little bit further out.
Current behavior:
You can see that the top buttons are overlapping the diagram. You can see from the scrolling bar on the side, that I could now scroll up a little bit (e.g. by calling diagram.alignDocument(go.Spot.Top, go.Spot.Center);
) but then not the whole diagram will be inside the view.
Expected behavior:
I would expect it to be zoomed out a little bit further so that the scrollMargin
at the top and bottom would fit.