Пример #1
0
        private void StartFillSequence(PointerEventInfo info)
        {
            if (!SourceValid)
                return;

            TileCoord location = TileLocation(info);
            if (!TileInRange(location))
                return;

            if (SourceType == TileSourceType.Brush) {
                Layer.TileAdding += TileAddingHandler;
                Layer.TileRemoving += TileRemovingHandler;
            }

            _fillLayer = Layer;
            _sourceStack = new TileStack();
            _sourceStack.Add(ActiveTile);

            _fillCommand = new TileReplace2DCommand(Layer);
            FloodFill(location.X, location.Y);

            if (SourceType == TileSourceType.Brush) {
                Layer.TileAdding -= TileAddingHandler;
                Layer.TileRemoving -= TileRemovingHandler;
            }

            History.Execute(_fillCommand);
        }
Пример #2
0
        private void StartDrawPathSequence(PointerEventInfo info)
        {
            if (ActiveTile == null && _activeBrush == null)
                return;

            _drawCommand = new TileReplace2DCommand(Layer);
        }
Пример #3
0
        private void EndEraseAreaSequence(PointerEventInfo info, ILevelGeometry viewport)
        {
            Rectangle selection = _band.Selection;

            TileReplace2DCommand command = new TileReplace2DCommand(Layer);
            for (int x = selection.Left; x < selection.Right; x++) {
                for (int y = selection.Top; y < selection.Bottom; y++) {
                    command.QueueReplacement(new TileCoord(x, y), (TileStack)null);
                    Layer[new TileCoord(x, y)] = null;
                }
            }

            History.Execute(command);

            _annots.Remove(_selection);
            _inAreaSequence = false;

            EndAutoScroll(info, viewport);
        }
Пример #4
0
        public FloatTileSelectionCommand(MultiTileGridLayer source, ITileSelectionLayer selectLayer)
        {
            _tileSource = source;
            _command = new TileReplace2DCommand(source);

            _selectLayer = selectLayer;
        }
Пример #5
0
 private void StartErasePathSequence(PointerEventInfo info)
 {
     _drawCommand = new TileReplace2DCommand(Layer);
 }