From d3efbb470f5ded5f7ce82ea781f1755ff7e05c9b Mon Sep 17 00:00:00 2001 From: rich2014 Date: Sun, 19 May 2024 17:27:17 +0800 Subject: [PATCH] Cocoa: Fix the position issue in TCocoaManualScrollHost.setFrame() for example: TTreeView --- lcl/interfaces/cocoa/cocoascrollers.pas | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lcl/interfaces/cocoa/cocoascrollers.pas b/lcl/interfaces/cocoa/cocoascrollers.pas index c586e49005..3aeb9a9cd9 100644 --- a/lcl/interfaces/cocoa/cocoascrollers.pas +++ b/lcl/interfaces/cocoa/cocoascrollers.pas @@ -420,10 +420,13 @@ end; procedure TCocoaManualScrollHost.setFrame(newValue: NSRect); var sc: TCocoaManualScrollView; + scFrame: NSRect; begin inherited setFrame(newValue); sc:= TCocoaManualScrollView(self.documentView); - sc.setFrame(newValue); + scFrame.origin:= NSZeroPoint; + scFrame.size:= self.contentSize; + sc.setFrame( scFrame ); updateDocSize(sc, sc.documentView, sc.horizontalScroller, sc.verticalScroller); end;