customdrawnws: Improves SelectObject to really return the old brush by using new capabilities from LazCanvas

git-svn-id: trunk@33715 -
This commit is contained in:
sekelsenmat 2011-11-23 07:58:18 +00:00
parent a885d9908b
commit fb6e9cb2b6

View File

@ -5285,6 +5285,7 @@ function TCDWidgetSet.SelectObject(DC: HDC; GDIObj: HGDIOBJ): HGDIOBJ;
var
aObject: TObject;
lBrush: TFPCustomBrush absolute AObject;
lOrigBrush: TFPCustomBrush;
{$ifdef VerboseWinAPI}
ObjType: string;
{$endif}
@ -5339,9 +5340,9 @@ begin
begin
{$ifdef VerboseWinAPI}ObjType := 'Brush';{$endif}
//Result := HGDIOBJ(TQtDeviceContext(DC).brush);
TLazCanvas(DC).Brush.FPColor := lBrush.FPColor;
Result := HGDIOBJ(TLazCanvas(DC).AssignedBrush);
TLazCanvas(DC).AssignBrushData(lBrush); // := doesn't work
TLazCanvas(DC).AssignedBrush := lBrush;
end(*
else if aObject is TQtImage then
begin