LCL TreeView: improved PaintNode code - Canvas.Font.Color should be correct in AdvencedCustomDraw

git-svn-id: trunk@17344 -
This commit is contained in:
tombo 2008-11-11 15:17:37 +00:00
parent 42b8e648ce
commit 72e53e15ea

View File

@ -4298,7 +4298,7 @@ var
var var
x, ImgIndex: integer; x, ImgIndex: integer;
CurBackgroundColor, OldFontColor: TColor; CurBackgroundColor: TColor;
CurTextRect: TRect; CurTextRect: TRect;
DrawState: TCustomDrawState; DrawState: TCustomDrawState;
PaintImages: boolean; PaintImages: boolean;
@ -4377,15 +4377,16 @@ begin
CurTextRect:=NodeRect; CurTextRect:=NodeRect;
CurTextRect.Left:=x; CurTextRect.Left:=x;
CurTextRect.Right:=x+TextWidth(Node.Text); CurTextRect.Right:=x+TextWidth(Node.Text);
OldFontColor:=Font.Color;
Font.Color:=InvertColor(Brush.Color); Font.Color:=InvertColor(Brush.Color);
FillRect(CurTextRect); FillRect(CurTextRect);
TextOut(x,TextY,Node.Text); TextOut(x,TextY,Node.Text);
Font.Color:=OldFontColor;
end end
else else
begin
Font.Color := Self.Font.Color;
TextOut(x,TextY,Node.Text); TextOut(x,TextY,Node.Text);
end; end;
end;
// draw separator // draw separator
if (tvoShowSeparators in FOptions) then if (tvoShowSeparators in FOptions) then