When you look at the source code of TZoomMouseWheelTool, method MousewheelDown, you see a code like this:
DoZoomStep(APoint, DoublePoint(ZoomFactor, ZoomFactor * ZoomRatio));
This performs the zooming operation centered at the point and using the DoublePoint with x and y zoom factors:
- xfactor = ZoomFactor
- yfactor = ZoomFactor * ZoomRatio
So, if you want to zoom only horizontally, the y zoom factor must be 1, i.e. ZoomFactor*ZoomRatio = 1, or ZoomRatio = 1/ZoomFactor. For example, when your ZoomFactor for the x axis is 1.1, then ZoomRatio must be 1/1.1 = 0.909
Similarly, if you only want to zoom vertically, the x factor must be 1, i.e. ZoomFactor = 1, and you can use ZoomRatio alone to determine the y zoom factor.
And finally, in the normal case, when x and y should zoom in the same ratio, you need to keep ZoomRatio at 1 and determine the overall zoom factor by the ZoomFactor alone.
Thank you for this question - it motivated me to figure this out...