Hi,
Thank you, your explanation has helped me understand the setZoomPivot behaviour better. I was able to see it working on the anchors sample and I was able to get this semi-working on my implementation too.
At the moment though the problem I am facing is that when I set the diagram bounds I have to always set the x and y to 0, 0 for the setZoomPivot function to work. If I set the x and y in diagram.setBounds to anything else then it stops zooming into the pivot and instead scrolls the diagram. I have attached 2 examples of this behaviour, Example 1 shows the pivot function working and Example 2 is the pivot behaviour broken.
Running this allows setZoomPivot to work//set diagram bounds bigger than viewport with {x: 0, y:0}
diagram.setBounds(new MindFusion.Drawing.Rect(0,0, (diagram.getViewport().width * 4), (diagram.getViewport().height * 4)));
//update canvas size
diagram.updateCanvasSize();
Example 1 working zoom:
Running this will break setZoomPivotI called zoomToFit() and this function changed the bounds of the diagram so I ran the code below again so that I could make the diagram bigger than the viewport again however this breaks the setZoomPivot functionality.
diagram bounds on load using diagram.getBounds();
{x: 485.99781092056395, y: 273.6348706185983, width: 90, height: 70}
//set diagram bounds bigger than viewport at the
diagram.setBounds(new MindFusion.Drawing.Rect(diagram.getBounds().x,diagram.getBounds().y, (diagram.getViewport().width * 4), (diagram.getViewport().height * 4)));
//update canvas size
diagram.updateCanvasSize();
Example 2 broken zoom:

Thank you
Danesh