Esempio n. 1
0
        /// <inheritdoc/>
        public override void RightDown(double x, double y)
        {
            base.RightDown(x, y);

            switch (_currentState)
            {
            case ToolState.None:
                break;

            case ToolState.One:
            case ToolState.Two:
            case ToolState.Three:
            {
                _toolPath.RemoveLastSegment <XCubicBezierSegment>();

                _editor.Project.CurrentContainer.WorkingLayer.Shapes = _editor.Project.CurrentContainer.WorkingLayer.Shapes.Remove(_toolPath._path);
                Remove();
                if (_toolPath._path.Geometry.Figures.LastOrDefault().Segments.Length > 0)
                {
                    Finalize(null);
                    _editor.Project.AddShape(_editor.Project.CurrentContainer.CurrentLayer, _toolPath._path);
                }
                else
                {
                    _editor.Project.CurrentContainer.WorkingLayer.Invalidate();
                }
                _toolPath.DeInitializeWorkingPath();
                _currentState           = ToolState.None;
                _editor.CancelAvailable = false;
            }
            break;
            }
        }