public void OnMouseDown(PointF screenLocation)
        {
            _mouseManager.Active       = true;
            _mouseManager.FirstCorner  = _convertWorldView.GetWorldPoint(screenLocation);
            _mouseManager.SecondCorner = _mouseManager.FirstCorner;

            switch (_modifiledObjectState)
            {
            case ModifiledObjectState.None:
                if ([email protected] && @interface.CanSelectObject && @interface.CurrentObject != null)
                {
                    @interface.RemoveLayerObject(@interface.CurrentObject);
                    @interface.CurrentObject = null;
                    @interface.RefreshCanvas();
                }
                _modifiledObjectState = ModifiledObjectState.Selecting;

                break;

            case ModifiledObjectState.Moving:
                if (_prepareObject != null)
                {
                    if ([email protected])
                    {
                        if (@interface.CurrentObject != null)
                        {
                            @interface.RemoveLayerObject(@interface.CurrentObject);
                        }
                        @interface.CurrentObject = new GroupSelectable();
                    }
                    else if (@interface.CurrentObject == null)
                    {
                        @interface.CurrentObject = new GroupSelectable();
                    }

                    @interface.CurrentObject.AddObject(_prepareObject);
                    @interface.AddLayerObject(@interface.CurrentObject);
                    @interface.RefreshCanvas();
                }
                break;

            case ModifiledObjectState.Sizing:
                break;
            }
        }
Пример #2
0
        public void OnMouseDown(MouseEventArgs mouseEvent)
        {
            if ([email protected])
            {
                return;
            }

            var p        = _convertWorldView.GetWorldPoint(mouseEvent.Location);
            int rowIndex = p.Y / @interface.TilesModel.TileHeight;
            int colIndex = p.X / @interface.TilesModel.TileWidth;

            if (rowIndex == oldRowIndex && colIndex == oldColIndex)
            {
                return;
            }

            oldRowIndex = rowIndex;
            oldColIndex = colIndex;

            @interface.AddTile(rowIndex, colIndex, @interface.SelectedTileIndex);
            @interface.RefreshCanvas();
        }