Use DrawLines method instead of AddLine loop

This commit is contained in:
Jaex 2016-09-02 19:53:53 +03:00
parent c483491611
commit 749bf6e3f0

View file

@ -123,14 +123,8 @@ public override void OnDraw(Graphics g)
else else
{ {
using (Pen pen = new Pen(BorderColor, BorderSize) { StartCap = LineCap.Round, EndCap = LineCap.Round, LineJoin = LineJoin.Round }) using (Pen pen = new Pen(BorderColor, BorderSize) { StartCap = LineCap.Round, EndCap = LineCap.Round, LineJoin = LineJoin.Round })
using (GraphicsPath gp = new GraphicsPath())
{ {
for (int i = 0; i < points.Count - 1; i++) g.DrawLines(pen, points.ToArray());
{
gp.AddLine(points[i], points[i + 1]);
}
g.DrawPath(pen, gp);
} }
} }