From c5fbc13f06fa81495932df278f1d2d366cf3925b Mon Sep 17 00:00:00 2001 From: Lukasz Baldyga Date: Wed, 21 Oct 2020 16:31:51 +0100 Subject: [PATCH] Properly rounding numbers in RegularPolygon --- .../Advanced Software Engineering/Command.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Advanced Software Engineering/Advanced Software Engineering/Command.cs b/Advanced Software Engineering/Advanced Software Engineering/Command.cs index 0adc30d..64e1433 100644 --- a/Advanced Software Engineering/Advanced Software Engineering/Command.cs +++ b/Advanced Software Engineering/Advanced Software Engineering/Command.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.CodeDom; using System.Collections.Generic; using System.Drawing; @@ -178,7 +178,7 @@ namespace Advanced_Software_Engineering { double dx = scale * Math.Sin(angle); double dy = scale * Math.Cos(angle); - points.Add(new Point((int)dx, (int)dy)); + points.Add(new Point((int) Math.Round(dx), (int) Math.Round(dy)); } this.sides = sides;