mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 15:50:25 +02:00
lcl: don't SetBkColor when Brush has hatched style (or we'll have solid fill on windows)
git-svn-id: trunk@16777 -
This commit is contained in:
parent
56d32cddab
commit
6176cdadd9
@ -30,7 +30,6 @@ begin
|
||||
inherited Create(SizeOf(TLogBrush));
|
||||
end;
|
||||
|
||||
|
||||
{ TBrush }
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
@ -142,6 +141,7 @@ begin
|
||||
|
||||
FreeReference;
|
||||
FReference._lclHandle := TLCLHandle(Value);
|
||||
FInternalUpdateIndex := GraphicsUpdateCount;
|
||||
Changed;
|
||||
end;
|
||||
|
||||
|
@ -129,6 +129,8 @@ end;
|
||||
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TCanvas.CreateBrush;
|
||||
const
|
||||
HatchBrushes = [bsHorizontal, bsVertical, bsFDiagonal, bsBDiagonal, bsCross, bsDiagCross];
|
||||
var
|
||||
OldHandle: HBRUSH;
|
||||
begin
|
||||
@ -139,7 +141,9 @@ begin
|
||||
if (OldHandle <> HBRUSH(Brush.Reference.Handle)) and (FSavedBrushHandle=0) then
|
||||
FSavedBrushHandle := OldHandle;
|
||||
Include(FState, csBrushValid);
|
||||
SetBkColor(FHandle, Brush.Color);
|
||||
// dont use color for hatched brushes. windows cannot draw hatches when SetBkColor is called
|
||||
if ([Brush.Style] * HatchBrushes) = [] then
|
||||
SetBkColor(FHandle, Brush.Color);
|
||||
if Brush.Style = bsSolid then
|
||||
SetBkMode(FHandle, OPAQUE)
|
||||
else
|
||||
|
@ -846,7 +846,7 @@ end;
|
||||
The CreateBrushIndirect function creates a logical brush that has the
|
||||
specified style, color, and pattern.
|
||||
------------------------------------------------------------------------------}
|
||||
function TWin32WidgetSet.CreateBrushIndirect(Const LogBrush: TLogBrush): HBRUSH;
|
||||
function TWin32WidgetSet.CreateBrushIndirect(const LogBrush: TLogBrush): HBRUSH;
|
||||
var
|
||||
LB: Windows.LogBrush;
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user