From d962babf60d14187543623d86ffbc5d028d8ff0f Mon Sep 17 00:00:00 2001 From: Lukasz Baldyga Date: Mon, 30 Nov 2020 09:28:11 +0000 Subject: [PATCH] Fixed bug where lines weren't drawn relative to the pen --- .../Advanced Software Engineering/Drawer.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Advanced Software Engineering/Advanced Software Engineering/Drawer.cs b/Advanced Software Engineering/Advanced Software Engineering/Drawer.cs index 9aa6313..a91bdea 100644 --- a/Advanced Software Engineering/Advanced Software Engineering/Drawer.cs +++ b/Advanced Software Engineering/Advanced Software Engineering/Drawer.cs @@ -146,6 +146,10 @@ namespace Advanced_Software_Engineering { throw new Exception("Cannot have less than two points in a line"); } + //Make it relative to the pen + for (int pointIndex = 0; pointIndex < points.Length; pointIndex++) + points[pointIndex] = new Point(points[pointIndex].X + penPosition.X, points[pointIndex].Y+ penPosition.Y); + GraphicsPath path = new GraphicsPath { FillMode = FillMode.Winding };