Some Zoom issues

This is really 3 questions/comments about zooming....

Simple comment: The atDiagram.zoom property is only updated after a MouseWheel event ends so getting the zoom value while in the event procedure returns the zoom value from before the event started. I got round this by starting a 10ms timer on MouseWheel and getting the new zoom value there.

Zooming about a point: The ZoomMoveToFit method is very handy, zooming and positioning the diagram in the center of the window. However zooming (in) after that expands the diagram about the top-left corner so the diagram rapidly disappears out the bottom right corner of the window. I have tried resetting the scrollbars to re-center the diagram but can't figure out what needs to go where and by how much. :-( If anyone has some code on how I can do this I would be most grateful! A method to zoom centered on the mouse position would be even better!

Diagram margins when zooming: When a diagram is zoomed in, the top and left 'margins' are maintained however the bottom and right edges of the window are set hard up against the edge of the diagram. This is ugly and not user friendly. I tried setting the atDiagram margin and increasing the ClientWidth/Height after a MouseWheel zoom event if the scrollbars are active but neither worked. 
Again, any solutions would be appreciated. 

David.
  1. That's expected as the OnMouseWheel event has a Handled property that if returned True will cancel the default diagram behavior. Thus the zoom is only affected after the event is processed.

    2. Sorry but I couldn't understand the steps to reproduce it. What do you mean by "zooming in" and "expands the diagram about the top-left corner"? I couldn't visualize it. Can you maybe provide a video to better illustrate it?

    3. Which diagram margins are you referring to? A screenshot would also help here, thank you.

Sorry if that is unclear. I have made a short screen capture video which I hope illustrates it. 

In the video I am zooming in using the mousewheel. At the end you can see that there is no room below the diagram.

That's also by design and expected. The margins are only applied when you call ZoomToFit. The diagram doesn't save the margins, when you zoom in, it recalculates the scrollbars.