From e01c9d3a71397d08e2d6bc03a3225154443471ea Mon Sep 17 00:00:00 2001 From: sekelsenmat Date: Fri, 6 Apr 2012 14:17:32 +0000 Subject: [PATCH] LCL-CustomDrawn: Improves DrawFocusRect to keep the canvas state git-svn-id: trunk@36611 - --- lcl/interfaces/customdrawn/customdrawnwinapi.inc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lcl/interfaces/customdrawn/customdrawnwinapi.inc b/lcl/interfaces/customdrawn/customdrawnwinapi.inc index e0bfd1219a..dfe19601f5 100644 --- a/lcl/interfaces/customdrawn/customdrawnwinapi.inc +++ b/lcl/interfaces/customdrawn/customdrawnwinapi.inc @@ -1057,8 +1057,11 @@ begin if not IsValidDC(DC) then exit; + // Drawer.DrawFocusRect alters the Pen and Brush, so we save the state here + LazDC.SaveState(); GetDefaultDrawer().DrawFocusRect(LazDC, Point(Rect.Left, Rect.Top), Size(Rect.Right - Rect.Left, Rect.Bottom - Rect.Top)); + LazDC.RestoreState(-1); end; function TCDWidgetSet.DrawFrameControl(DC: HDC; const Rect: TRect; uType,