public static void GenerateEllipseNonAlloc(Coordinates start, Coordinates end, bool fill, List <Coordinates> output) { DoubleCoords fixedCoordinates = CalculateCoordinatesForShapeRotation(start, end); EllipseGenerator.GenerateEllipseFromRect(fixedCoordinates, output); if (fill) { CalculateFillForEllipse(output); } }
private static void CalculateFillForEllipse(List <Coordinates> outlineCoordinates) { if (!outlineCoordinates.Any()) { return; } var lines = EllipseGenerator.SplitEllipseIntoLines(outlineCoordinates); foreach (var line in lines) { for (int i = line.Coords1.X; i <= line.Coords2.X; i++) { outlineCoordinates.Add(new Coordinates(i, line.Coords1.Y)); } } }