mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-21 03:59:12 +02:00
Gtk2: fixed text background drawing in TGtk2WidgetSet.ExtTextOut() when BkMode = OPAQUE.issue #19384
git-svn-id: trunk@36929 -
This commit is contained in:
parent
140d76e610
commit
ca6e3b563c
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user