if (points == null)\r
throw new ArgumentNullException("points");\r
\r
- for (int i = 0; i < points.Length - 1; i += 1) \r
- AddLine(points[i].X, points [i].Y, points [i+1].X, points [i+1].Y);\r
+ if (points.Length == 0)\r
+ return;\r
+\r
+ if (_isNewFigure)\r
+ NativeObject.moveTo(points[0].X, points[0].Y);\r
+ else\r
+ NativeObject.lineTo(points[0].X, points[0].Y);\r
+\r
+ _isNewFigure = false;\r
+\r
+ for (int i = 1; i < points.Length; i ++)\r
+ NativeObject.lineTo(points[i].X, points[i].Y);\r
}\r
\r
public void AddLines (PointF [] points)\r
if (points == null)\r
throw new ArgumentNullException("points");\r
\r
- for (int i = 0; i < points.Length - 1; i += 1) \r
- AddLine(points[i].X, points [i].Y, points [i+1].X, points [i+1].Y);\r
+ if (points.Length == 0)\r
+ return;\r
+\r
+ if (_isNewFigure)\r
+ NativeObject.moveTo(points[0].X, points[0].Y);\r
+ else\r
+ NativeObject.lineTo(points[0].X, points[0].Y);\r
+\r
+ _isNewFigure = false;\r
+\r
+ for (int i = 1; i < points.Length; i ++)\r
+ NativeObject.lineTo(points[i].X, points[i].Y);\r
}\r
#endregion\r
\r