summaryrefslogtreecommitdiff
path: root/src/corelib/render/software
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2013-03-27 17:32:26 +0000
committerGraeme Geldenhuys <graemeg@gmail.com>2013-03-27 17:32:26 +0000
commit51f318480fb8e5fef8314186a882a49bc93009af (patch)
treed97e4628b0ab4d33965e774dd3f3e4c50a0cdf37 /src/corelib/render/software
parent255e943caa0d000f43f98442297f55413fa816ed (diff)
downloadfpGUI-51f318480fb8e5fef8314186a882a49bc93009af.tar.xz
aggpas backend: finally implemented DoDrawPolygon()
Rather late than never. ;-)
Diffstat (limited to 'src/corelib/render/software')
-rw-r--r--src/corelib/render/software/Agg2D.pas15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/corelib/render/software/Agg2D.pas b/src/corelib/render/software/Agg2D.pas
index 36737c2b..280736af 100644
--- a/src/corelib/render/software/Agg2D.pas
+++ b/src/corelib/render/software/Agg2D.pas
@@ -3749,8 +3749,21 @@ begin
end;
procedure TAgg2D.DoDrawPolygon(Points: PPoint; NumPts: Integer; Winding: boolean);
+var
+ i: integer;
+ poly: array of double;
begin
-
+ SetLength(poly, (NumPts*2)+1); // dynamic arrays start at 0, but we want to use 1..NumPts
+ for i := 1 to NumPts do
+ begin
+ poly[i * 2 - 1] := Points[i-1].X + 0.5;
+ poly[i * 2] := Points[i-1].Y + 0.5;
+ end;
+ // Draw Polygon
+ LineWidth(1);
+ LineColor(LineColor);
+ FillColor($00, $00, $00); // clBlack for now
+ Polygon(@poly[1], NumPts);
end;