public void Draw(IPixelSet pixelSet, IDrawingArea drawingArea) { this.pixelSet = pixelSet; this.drawingArea = drawingArea; if (afterClick) { if (list == null) { list = new List <Point>(); if (!afterMove) { thread = new Thread(Fill) { }; thread.Start(); } else { Fill(); drawingArea.Redraw(); } } else { DrawStack(pixelSet); } } }
public void Fill(int x, int y) { if (!pixelSet.CellIsInArea(x, y)) { return; } if (pixelSet.IsNotFilled(x, y)) { lock (list) list.Add(new Point(x, y)); pixelSet.AddPoint(x, y); if (!afterMove) { drawingArea.Redraw(); thread.Join(5); } } else { return; } Fill(x + 1, y); Fill(x - 1, y); Fill(x, y + 1); Fill(x, y - 1); }
public void Draw(IPixelSet pixelSet, IDrawingArea drawingArea) { this.pixelSet = pixelSet; this.drawingArea = drawingArea; if (afterClick) if (list == null) { list = new List<Point>(); if (!afterMove) { thread = new Thread(Fill) {}; thread.Start(); } else { Fill(); drawingArea.Redraw(); } } else { DrawStack(pixelSet); } }