ZoomIn - again (sorry!)

Sorry to bring this up again, but I - and my users - are really not happy with the behaviour of the ZoomIn function. The remarks for ZoomIn state: Call ZoomIn to zoom in the diagram to the rect specified by ARect parameter however this is not what happens when ZoomIn is called. What actually happens is the diagram is zoomed and moved to (roughly) center the top-left corner of the rect at a zoom level that is greater than needed to view the selected rectangle.
Attached is a small project to show the behaviour. Just draw some rectangles on the diagram then click Zoom In and try to select an area.
ZoomInTest.zip (7.3 KB)

I don't see any problem with it. The zoom in operation is aimed to provide details about a specific portion of the screen. That is, if you select a rectangle that is a portion of the diagram, it will "zoom in" and display that portion in the "whole screen" (diagram area).

In the video below you can see your demo in action. When I zoom in by selecting the star, for example the star is displayed in the diagram area. It works as designed.

Well, it does not do that on my PC!
Video on WeTransfer
Any suggestions as to why it might not work for me? I do have 2 monitors with different resolutions and scaling (3480x2160 @ 150% / 1920x1080 @ 100%) but the app behaves the same on both.

I see now that is a problem with high DPI. It doesn't happen in the normal, 96 DPI. We have fixed this internally, you can fix it directly in your code by changing the TatDiagram.ZoomIn method.

Around line 16561 make the following changes:

    if r1 < r2 then
      FZoomRatio := r1 / ScreenDPIRatio
      FZoomRatio := r2 / ScreenDPIRatio;

Around line 16582 do the following changes:

    HorzScrollBar.Position := Round(Trunc(((ARect.Left + ARect.Right) / 2) * FZoomRatio * ScreenDPIRatio) - wc / 2);
    VertScrollBar.Position := Round(Trunc(((ARect.top + ARect.Bottom) / 2) * FZoomRatio * ScreenDPIRatio) - hc / 2);

It should fix the issue.