public override void MouseUp(int x, int y)
 {
     if (currentBrushPath != null)
     {
         //currentBrushPath.Close();
         currentBrushPath.GetSmooth();
         currentBrushPath = null;
     }
     base.MouseUp(x, y);
 }
Beispiel #2
0
        public override void MouseUp(int x, int y)
        {
            if (currentBrushPath != null)
            {
                currentBrushPath.GetSmooth();
                switch (currentBrushPath.BrushMode)
                {
                case SmoothBrushMode.CutBrush:
                {
                    if (myBrushPathList.Count > 0)
                    {
                        //1. remove
                        myBrushPathList.RemoveAt(myBrushPathList.Count - 1);
                        //

                        if (myBrushPathList.Count > 0)
                        {
                            var lastPath = myBrushPathList[myBrushPathList.Count - 1];

                            //do path clip***

                            PathWriter result = CombinePaths(
                                new VertexStoreSnap(lastPath.vxs),
                                new VertexStoreSnap(currentBrushPath.vxs),
                                ClipType.ctDifference);

                            myBrushPathList.RemoveAt(myBrushPathList.Count - 1);

                            MyBrushPath newBrushPath = new MyBrushPath();
                            newBrushPath.BrushMode   = lastPath.BrushMode;
                            newBrushPath.StrokeColor = lastPath.StrokeColor;
                            newBrushPath.FillColor   = lastPath.FillColor;
                            newBrushPath.vxs         = result.Vxs;
                            myBrushPathList.Add(newBrushPath);
                        }
                    }
                } break;
                }
                currentBrushPath = null;
            }

            base.MouseUp(x, y);
        }