From d9d4cafa4014424d94b4b53fd9028b5726568d63 Mon Sep 17 00:00:00 2001 From: zeljko Date: Thu, 26 Apr 2012 06:48:06 +0000 Subject: [PATCH] Gtk2: fixed drawing of text with solid brush. issue #21863 git-svn-id: trunk@37029 - --- lcl/interfaces/gtk2/gtk2winapi.inc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lcl/interfaces/gtk2/gtk2winapi.inc b/lcl/interfaces/gtk2/gtk2winapi.inc index a929b38a9a..9b867dfe20 100644 --- a/lcl/interfaces/gtk2/gtk2winapi.inc +++ b/lcl/interfaces/gtk2/gtk2winapi.inc @@ -3899,8 +3899,7 @@ begin ((Options and ETO_OPAQUE) = 0) and (DevCtx.BkMode = OPAQUE) then // (Rect = nil) then TODO: see if Rect<> nil is needed begin - //writeln('<*> Brush ? ',DevCtx.GDIObjects[gdiBrush]^.GDIBrushFill,' MODE ',DevCtx.BkMode, - // ' ClipRect ',dbgs(RectFromGdkRect(DevCtx.ClipRect))); + EnsureGCColor(DC, dccGDIBrushColor, DevCtx.GDIObjects[gdiBrush]^.GDIBrushFill = GDK_SOLID, True); BackGroundColor := @DevCtx.GDIObjects[gdiBrush]^.GDIBrushColor.Color; end; @@ -9629,6 +9628,7 @@ var DevCtx: TGtk2DeviceContext absolute DC; DCOrigin: TPoint; yOffset: integer; + BackGroundColor: PGdkColor; begin Result := IsValidDC(DC); if not Result then Exit; @@ -9649,9 +9649,16 @@ begin DevCtx.SelectedColors := dcscCustom; EnsureGCColor(DC, dccCurrentTextColor, True, False); + BackGroundColor := nil; + if (DevCtx.GDIObjects[gdiBrush] <> nil) and (DevCtx.BkMode = OPAQUE) then + begin + EnsureGCColor(DC, dccCurrentBackColor, DevCtx.GDIObjects[gdiBrush]^.GDIBrushFill = GDK_SOLID, True); + BackGroundColor := @DevCtx.CurrentBackColor.Color; + end; + DevCtx.DrawTextWithColors(Str, Count, X + DCOrigin.X, Y + DCOrigin.Y + yOffset, - nil, nil); + nil, BackGroundColor); end; function TGtk2WidgetSet.UpdateWindow(Handle: HWND): Boolean;