mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 04:59:08 +02:00
LCL: TCanvas.DrawText: changing and restoring BKMode when Style.Opaque=false
git-svn-id: trunk@10766 -
This commit is contained in:
parent
e730abc793
commit
91e8c58c50
@ -12,7 +12,6 @@
|
|||||||
</General>
|
</General>
|
||||||
<PublishOptions>
|
<PublishOptions>
|
||||||
<Version Value="2"/>
|
<Version Value="2"/>
|
||||||
<IgnoreBinaries Value="False"/>
|
|
||||||
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||||
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||||
</PublishOptions>
|
</PublishOptions>
|
||||||
|
@ -1049,16 +1049,24 @@ begin
|
|||||||
Options := Options or DT_NOCLIP; // no clipping as we are handling it here
|
Options := Options or DT_NOCLIP; // no clipping as we are handling it here
|
||||||
end;
|
end;
|
||||||
|
|
||||||
If Style.Opaque then begin
|
if Style.Opaque then begin
|
||||||
RequiredState([csHandleValid, csBrushValid]);
|
RequiredState([csHandleValid, csBrushValid]);
|
||||||
FillRect(fRect);
|
FillRect(fRect);
|
||||||
|
end else begin
|
||||||
|
SetBkMode(FHandle, TRANSPARENT);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
If Style.SystemFont then
|
if Style.SystemFont then
|
||||||
SetTextColor(Self.Handle, Font.Color);
|
SetTextColor(Self.Handle, Font.Color);
|
||||||
//debugln('TCanvas.TextRect DRAW Text="',Text,'" ',dbgs(fRect));
|
//debugln('TCanvas.TextRect DRAW Text="',Text,'" ',dbgs(fRect));
|
||||||
DrawText(Self.Handle, pChar(Text), Length(Text), fRect, Options);
|
DrawText(Self.Handle, pChar(Text), Length(Text), fRect, Options);
|
||||||
|
|
||||||
|
if Style.Opaque and (csBrushValid in FState) then begin
|
||||||
|
if Brush.Style=bsSolid then
|
||||||
|
// restore BKMode
|
||||||
|
SetBkMode(FHandle, OPAQUE)
|
||||||
|
end;
|
||||||
|
|
||||||
if Style.Clipping then begin
|
if Style.Clipping then begin
|
||||||
if DCIndex <> -1 then
|
if DCIndex <> -1 then
|
||||||
RestoreDC(Self.Handle, DCIndex);
|
RestoreDC(Self.Handle, DCIndex);
|
||||||
|
Loading…
Reference in New Issue
Block a user