Cocoa: fix cursor calculation issue in TabControl

In fact, it is related to the container control with LayoutDelta. currently, only TabControl in Cocoa is affected by this bug.
This commit is contained in:
rich2014 2023-08-01 22:49:13 +08:00
parent a0e0744618
commit 64aab7afc8

View File

@ -491,7 +491,12 @@ begin
cr := NSView(Owner).lclClientFrame;
PtInClient.x := Round({PtInBounds.x - }pt.x - cr.Left);
PtInClient.y := Round({PtInBounds.y - }pt.y - cr.Top);
// child ctrls need not LayoutDelta,
cr := NSView(Owner).lclGetFrameToLayoutDelta;
PtForChildCtrls := PtInClient;
PtForChildCtrls.X := PtForChildCtrls.X + cr.Left;
PtForChildCtrls.Y := PtForChildCtrls.Y + cr.Top;
es := NSView(Owner).enclosingScrollView;
if Assigned(es) and (es.documentView = NSView(Owner)) then begin