Commit ca6e3b56 authored by Željan Rikalo's avatar Željan Rikalo 🏊🏼
Browse files

Gtk2: fixed text background drawing in TGtk2WidgetSet.ExtTextOut() when BkMode...

Gtk2: fixed text background drawing in TGtk2WidgetSet.ExtTextOut() when BkMode = OPAQUE.issue #19384

git-svn-id: trunk@36929 -
parent 140d76e6
......@@ -3812,7 +3812,7 @@ var
TopY, LineLen, LineHeight: Integer;
TxtPt: TPoint;
DCOrigin: TPoint;
Foreground: PGDKColor;
Foreground, BackgroundColor: PGDKColor;
CurDx: PInteger;
CurStr: PChar;
......@@ -3827,7 +3827,7 @@ var
while CurCount > 0 do
begin
CharLen := UTF8CharacterLength(CurStr);
DevCtx.DrawTextWithColors(CurStr, CharLen, CurScreenX, Y, Foreground, nil);
DevCtx.DrawTextWithColors(CurStr, CharLen, CurScreenX, Y, Foreground, BackgroundColor);
inc(CurScreenX, CurDx^);
inc(CurDx);
inc(CurStr, CharLen);
......@@ -3835,7 +3835,7 @@ var
end;
end
else
DevCtx.DrawTextWithColors(Str, Count, X, Y, Foreground, nil);
DevCtx.DrawTextWithColors(Str, Count, X, Y, Foreground, BackgroundColor);
end;
begin
......@@ -3854,6 +3854,8 @@ begin
exit;
end;
BackgroundColor := nil;
// to reduce flickering calculate first and then paint
DCOrigin := DevCtx.Offset;
......@@ -3892,6 +3894,16 @@ begin
Width, Height);
end;
if (DevCtx.GDIObjects[gdiBrush] <> nil) and
((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)));
BackGroundColor := @DevCtx.GDIObjects[gdiBrush]^.GDIBrushColor.Color;
end;
EnsureGCColor(DC, dccCurrentTextColor, True, False);
Foreground := nil;//StyleForegroundColor(CurrentTextColor.ColorRef, nil);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment