Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
        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));
                }
            }
        }