Example #1
0
    void OnToolChanged(ToolType toolType)
    {
        if (toolType == ToolType.PencilPaintTool)
        {
            Cursor.SetCursorType(CursorType.PencilActionCursor);
        }
        else if (toolType == ToolType.BrushPaintTool)
        {
            Cursor.SetCursorType(CursorType.BrushActionCursor);
        }
        else if (toolType == ToolType.EraserTool)
        {
            Cursor.SetCursorType(CursorType.EraserActionCursor);
        }
        else if (toolType == ToolType.BrushPaintTool)
        {
            Cursor.SetCursorType(CursorType.BrushActionCursor);
        }
        else if (toolType == ToolType.MagicNewTool)
        {
            Cursor.SetCursorType(CursorType.MagicNewCursor);
        }
        else if (toolType == ToolType.MagicAddTool)
        {
            Cursor.SetCursorType(CursorType.MagicAddCursor);
        }
        else if (toolType == ToolType.MagicSubTool)
        {
            Cursor.SetCursorType(CursorType.MagicSubCursor);
        }
        else if (toolType == ToolType.TransTool)
        {
            Cursor.HideCursor();
            drawing.ApplySelection();
            SelectionTouch.Active = true;
            CursorTouch.Active    = false;
        }

        if (CurrentTool == ToolType.TransTool && toolType != ToolType.TransTool)
        {
            drawing.ApplyTransform();
            SelectionTouch.Active = false;
            CursorTouch.Active    = true;
        }

        CurrentTool = toolType;
    }