Qt: bugfix - TQtWidgetSet.Polygon() was wrong on MacOsX.

git-svn-id: trunk@18620 -
This commit is contained in:
zeljko 2009-02-09 17:01:26 +00:00
parent be1f7a30e1
commit 00da47ed08

View File

@ -3799,6 +3799,9 @@ end;
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
function TQtWidgetSet.Polygon(DC: HDC; Points: PPoint; NumPts: Integer; function TQtWidgetSet.Polygon(DC: HDC; Points: PPoint; NumPts: Integer;
Winding: Boolean): boolean; Winding: Boolean): boolean;
var
QtPoints: PQtPoint;
i: integer;
begin begin
{$ifdef VerboseQtWinAPI} {$ifdef VerboseQtWinAPI}
WriteLn('[WinAPI Polygon] DC: ', dbghex(DC)); WriteLn('[WinAPI Polygon] DC: ', dbghex(DC));
@ -3806,13 +3809,17 @@ begin
Result := IsValidDC(DC); Result := IsValidDC(DC);
if Result then if Result then
begin begin
GetMem(QtPoints, NumPts * SizeOf(TQtPoint));
for i := 0 to NumPts - 1 do
QtPoints[i] := QtPoint(Points[i].x, Points[i].y);
{TODO: discuss with other developers about antialiasing by default} {TODO: discuss with other developers about antialiasing by default}
// QPainter_setRenderHint(TQtDeviceContext(DC).Widget, QPainterAntialiasing, True); // QPainter_setRenderHint(TQtDeviceContext(DC).Widget, QPainterAntialiasing, True);
if Winding if Winding
then then
QPainter_drawPolygon(TQtDeviceContext(DC).Widget, PQtPoint(Points), NumPts, QtWindingFill) QPainter_drawPolygon(TQtDeviceContext(DC).Widget, QtPoints, NumPts, QtWindingFill)
else else
QPainter_drawPolygon(TQtDeviceContext(DC).Widget, PQtPoint(Points), NumPts, QtOddEvenFill); QPainter_drawPolygon(TQtDeviceContext(DC).Widget, QtPoints, NumPts, QtOddEvenFill);
FreeMem(QtPoints);
end; end;
end; end;