Use AddPolygon method instead of AddLine loop

This commit is contained in:
Jaex 2016-09-02 20:02:06 +03:00
parent 749bf6e3f0
commit 1d24e205b2

View file

@ -97,16 +97,9 @@ public override void OnUpdate()
public override void OnShapePathRequested(GraphicsPath gp, Rectangle rect)
{
if (points.Count > 1)
if (points.Count > 2)
{
gp.StartFigure();
for (int i = 0; i < points.Count - 1; i++)
{
gp.AddLine(points[i], points[i + 1]);
}
gp.CloseFigure();
gp.AddPolygon(points.ToArray());
}
}