Ejemplo n.º 1
0
        private void EndEraseAreaSequence(PointerEventInfo info, ILevelGeometry viewport)
        {
            Rectangle selection = _band.Selection;
            int       xmin      = Math.Max(Layer.TileOriginX, selection.Left);
            int       ymin      = Math.Max(Layer.TileOriginY, selection.Top);
            int       xmax      = Math.Min(Layer.TileOriginX + Layer.TilesWide, selection.Right);
            int       ymax      = Math.Min(Layer.TileOriginY + Layer.TilesHigh, selection.Bottom);

            TileReplace2DCommand command = new TileReplace2DCommand(Layer);

            for (int x = xmin; x < xmax; x++)
            {
                for (int y = ymin; y < ymax; 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);
        }
Ejemplo n.º 2
0
        private void UpdateErasePathSequence(PointerEventInfo info)
        {
            TileCoord location = TileLocation(info);

            if (!TileInRange(location))
            {
                return;
            }

            if (Layer[location] != null && Layer[location].Count > 0)
            {
                _drawCommand.QueueReplacement(location, (TileStack)null);
                Layer[location] = null;
            }
        }
Ejemplo n.º 3
0
        private void EndEraseAreaSequence(PointerEventInfo info, ILevelGeometry viewport)
        {
            Rectangle selection = _band.Selection;
            int xmin = Math.Max(Layer.TileOriginX, selection.Left);
            int ymin = Math.Max(Layer.TileOriginY, selection.Top);
            int xmax = Math.Min(Layer.TileOriginX + Layer.TilesWide, selection.Right);
            int ymax = Math.Min(Layer.TileOriginY + Layer.TilesHigh, selection.Bottom);

            TileReplace2DCommand command = new TileReplace2DCommand(Layer);
            for (int x = xmin; x < xmax; x++) {
                for (int y = ymin; y < ymax; 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);
        }