From 1d24e205b266c520edb171bb8ebd3f7fe89a8efc Mon Sep 17 00:00:00 2001 From: Jaex Date: Fri, 2 Sep 2016 20:02:06 +0300 Subject: [PATCH] Use AddPolygon method instead of AddLine loop --- .../Shapes/Region/FreehandRegionShape.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/ShareX.ScreenCaptureLib/Shapes/Region/FreehandRegionShape.cs b/ShareX.ScreenCaptureLib/Shapes/Region/FreehandRegionShape.cs index 75f9da603..1637a16a1 100644 --- a/ShareX.ScreenCaptureLib/Shapes/Region/FreehandRegionShape.cs +++ b/ShareX.ScreenCaptureLib/Shapes/Region/FreehandRegionShape.cs @@ -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()); } }