コード例 #1
0
ファイル: Form1.cs プロジェクト: duong1090/Paint-software
        public void ChooseTheWayToEnd(MouseEventArgs e)
        {
            Shape theLastShape = listShapes[listShapes.Count - 1];

            if (status == Status.Curve)
            {
                if (isCurve)
                {
                    if (isSecondClickCurve)
                    {
                        theLastShape.ListPoints[2] = e.Location;
                        isSecondClickCurve         = false;
                        isCurve = false;
                    }
                    else
                    {
                        theLastShape.ListPoints[1] = e.Location;
                        theLastShape.ListPoints[2] = theLastShape.ListPoints[3];
                        isSecondClickCurve         = true;
                    }
                }
                else
                {
                    theLastShape.ListPoints[3] = e.Location;
                    isCurve = true;
                }
            }


            else
            {
                theLastShape.ListPoints[theLastShape.ListPoints.Count - 1] = e.Location;
            }

            theLastShape.DistaceWithCenter();
        }