Пример #1
0
        private void PlotCell(SurfaceEditor surface, int x, int y, int glyph, bool fillMe = false)
        {
            if (surface.IsValidCell(x, y))
            {
                var cell = surface[x, y];

                if (fillMe)
                {
                    cell.Background = FillColor;
                    cell.Foreground = Foreground;
                    cell.Glyph      = glyph;
                    return;
                }

                if (Foreground != Color.Transparent || DrawTransparency)
                {
                    cell.Foreground = Foreground;
                }

                if (BorderBackground != Color.Transparent || DrawTransparency)
                {
                    cell.Background = BorderBackground;
                }

                cell.Glyph = glyph;
            }
        }
Пример #2
0
        public void Draw(SurfaceEditor surface)
        {
            if (BorderAppearance == null)
            {
                BorderAppearance = new CellAppearance(Color.Blue, Color.Black, 4);
            }

            Algorithms.Circle(Center.X, Center.Y, Radius, (x, y) => { if (surface.IsValidCell(x, y))
                                                                      {
                                                                          surface.SetCellAppearance(x, y, BorderAppearance);
                                                                      }
                              });
        }
Пример #3
0
        //public ICellAppearance FillAppearance;
        //public bool Fill;

        public void Draw(SurfaceEditor surface)
        {
            Algorithms.Ellipse(StartingPoint.X, StartingPoint.Y, EndingPoint.X, EndingPoint.Y, (x, y) => { if (surface.IsValidCell(x, y))
                                                                                                           {
                                                                                                               surface.SetCellAppearance(x, y, BorderAppearance);
                                                                                                           }
                               });
        }
Пример #4
0
        /// <summary>
        /// Draws the line shape.
        /// </summary>
        /// <param name="surface">The cell surface to draw on.</param>
        public void Draw(SurfaceEditor surface)
        {
            List <Cell> cells = new List <Cell>();

            Algorithms.Line(StartingLocation.X, StartingLocation.Y, EndingLocation.X, EndingLocation.Y, (x, y) => { if (surface.IsValidCell(x, y))
                                                                                                                    {
                                                                                                                        cells.Add(surface[x, y]);
                                                                                                                    }
                                                                                                                    return(true); });

            if (cells.Count > 1)
            {
                if (UseStartingCell)
                {
                    cells[0].CopyAppearanceFrom(StartingCell);
                }
                else
                {
                    cells[0].CopyAppearanceFrom(Cell);
                }

                if (UseEndingCell)
                {
                    cells[cells.Count - 1].CopyAppearanceFrom(EndingCell);
                }
                else
                {
                    cells[cells.Count - 1].CopyAppearanceFrom(Cell);
                }

                for (int i = 1; i < cells.Count - 1; i++)
                {
                    cells[i].CopyAppearanceFrom(Cell);
                }
            }
            else if (cells.Count == 1)
            {
                cells[0].CopyAppearanceFrom(Cell);
            }
        }