From 789abf9d79e09b0000e0cff98287593f686a33da Mon Sep 17 00:00:00 2001 From: dmitry Date: Sun, 7 Jan 2018 15:51:43 +0000 Subject: [PATCH] cocoa: replacing instance call with class method call when scrollbar frames. #32966 git-svn-id: trunk@57003 - --- lcl/interfaces/cocoa/cocoaprivate.pp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lcl/interfaces/cocoa/cocoaprivate.pp b/lcl/interfaces/cocoa/cocoaprivate.pp index 4b2648b112..7f2ddf24c6 100644 --- a/lcl/interfaces/cocoa/cocoaprivate.pp +++ b/lcl/interfaces/cocoa/cocoaprivate.pp @@ -1066,6 +1066,8 @@ var f : NSRect; hr : NSRect; vr : NSRect; + hw : CGFLoat; + vw : CGFLoat; begin if not Assigned(parent) or not Assigned(doc) then Exit; @@ -1074,26 +1076,28 @@ begin f.origin.y := 0; hr := f; vr := f; - vr.size.width:=vrt.scrollerWidth; + hw := NSScroller.scrollerWidth; + vw := NSScroller.scrollerWidth; + vr.size.width:=vw; vr.origin.x:=f.size.width-vr.size.width; - hr.size.height:=hrz.scrollerWidth; + hr.size.height:=hw; if Assigned(hrz) and (not hrz.isHidden) then begin - f.size.height := f.size.height-hrz.scrollerWidth; - f.origin.y := hrz.scrollerWidth; + f.size.height := f.size.height - hw; + f.origin.y := hw; - vr.origin.y := hrz.scrollerWidth; - vr.size.height := vr.size.height - hrz.scrollerWidth; + vr.origin.y := hw; + vr.size.height := vr.size.height - hw; if Assigned(vrt) and (not vrt.isHidden) then - hr.size.width:=hr.size.width-vrt.scrollerWidth; + hr.size.width:=hr.size.width-vw; hrz.setFrame(hr); end; if Assigned(vrt) and (not vrt.isHidden) then begin - f.size.width := f.size.width-vrt.scrollerWidth; + f.size.width := f.size.width-vw; vrt.setFrame(vr); end;