From a78e37d9b23f632da6939499bbe96e9172d26a7e Mon Sep 17 00:00:00 2001 From: dmitry Date: Fri, 24 Aug 2018 03:08:10 +0000 Subject: [PATCH] cocoa: themedrawing swithcing the current graphic context git-svn-id: trunk@58766 - --- lcl/interfaces/cocoa/cocoathemes.pas | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lcl/interfaces/cocoa/cocoathemes.pas b/lcl/interfaces/cocoa/cocoathemes.pas index e920be578e..136ca34b0c 100644 --- a/lcl/interfaces/cocoa/cocoathemes.pas +++ b/lcl/interfaces/cocoa/cocoathemes.pas @@ -180,18 +180,26 @@ var acc : TCocoaContextAccess; nsr : NSRect; dr : NSRect; + + cur : NSGraphicsContext; begin cl := GetCellForDetails(Details); if Assigned(cl) then begin acc := TCocoaContextAccess(DC); + + cur := NSGraphicsContext.currentContext; + NSGraphicsContext.setCurrentContext( acc.ctx ); + acc.SetCGFillping(acc.CGContext, 0, -acc.Size.cy); try LCLToNSRect( R, acc.size.cy, dr); cl.drawWithFrame_inView (dr, nil ); finally acc.SetCGFillping(acc.CGContext, 0, -acc.Size.cy); + NSGraphicsContext.setCurrentContext( cur ); end; + Exit; end; @@ -399,6 +407,8 @@ begin lBrush := TCocoaBrush.Create(lColor, False); DC.Rectangle(R.Left, R.Top, R.Right, R.Bottom, True, lBrush); lBrush.Free; + + Result := R; end; TVP_GLYPH, TVP_HOTGLYPH: begin @@ -463,6 +473,8 @@ begin Result := R; {$endif} end; + else + Result := Bounds(0,0,0,0); end; end;