Пример #1
0
 public MoveTool(PathTool pathTool)
 {
     PathTool = pathTool;
 }
Пример #2
0
        public override void LeftDown(IToolContext context, double x, double y, Modifier modifier)
        {
            base.LeftDown(context, x, y, modifier);

            PathTool.Move();
        }
Пример #3
0
        private void SwitchPathTool(double x, double y)
        {
            switch (_previousPathTool)
            {
            case PathTool.Line:
            {
                RemoveLastSegment <XLineSegment>();
                _toolPathLine.Remove();
            }
            break;

            case PathTool.Arc:
            {
                RemoveLastSegment <XArcSegment>();
                _toolPathArc.Remove();
            }
            break;

            case PathTool.CubicBezier:
            {
                RemoveLastSegment <XCubicBezierSegment>();
                _toolPathCubicBezier.Remove();
            }
            break;

            case PathTool.QuadraticBezier:
            {
                RemoveLastSegment <XQuadraticBezierSegment>();
                _toolPathQuadraticBezier.Remove();
            }
            break;

            case PathTool.Move:
                break;
            }

            switch (_editor.CurrentPathTool)
            {
            case PathTool.Line:
            {
                _toolPathLine.LeftDown(x, y);
            }
            break;

            case PathTool.Arc:
            {
                _toolPathArc.LeftDown(x, y);
            }
            break;

            case PathTool.CubicBezier:
            {
                _toolPathCubicBezier.LeftDown(x, y);
            }
            break;

            case PathTool.QuadraticBezier:
            {
                _toolPathQuadraticBezier.LeftDown(x, y);
            }
            break;

            case PathTool.Move:
            {
                _editor.Project.CurrentContainer.WorkingLayer.Invalidate();
                _editor.Project.CurrentContainer.HelperLayer.Invalidate();
            }
            break;
            }

            if (_editor.CurrentPathTool == PathTool.Move)
            {
                _movePathTool = _previousPathTool;
            }

            _previousPathTool = _editor.CurrentPathTool;
        }