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:
paul 2008-09-29 05:04:11 +00:00
parent 56d32cddab
commit 6176cdadd9
3 changed files with 7 additions and 3 deletions

View File

@ -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;

View File

@ -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

View File

@ -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