Beispiel #1
0
        public override bool MouseDown(MouseEventArgs e)
        {
            bool vResult = FShapeLine.MouseDown(e);

            Active = FShapeLine.ActiveObj != HCShapeLineObj.sloNone;
            if (Active)
            {
                if (e.Button == MouseButtons.Left)
                {
                    this.Resizing = ((FShapeLine.ActiveObj == HCShapeLineObj.sloStart) || (FShapeLine.ActiveObj == HCShapeLineObj.sloEnd));

                    if (this.Resizing)
                    {
                        this.FResizeX = e.X;
                        this.FResizeY = e.Y;
                        FLeftTop      = GetShapeLeftTop(); // 缩放前的Rect的LeftTop
                    }
                    else
                    if (FShapeLine.ActiveObj == HCShapeLineObj.sloLine)
                    {
                        FLeftTop = GetShapeLeftTop();  // 移动前的Rect的LeftTop
                    }
                }
            }

            return(vResult);
        }
Beispiel #2
0
        public override bool MouseDown(MouseEventArgs e)
        {
            bool vResult = FShapeLine.MouseDown(e);

            Active = FShapeLine.ActiveObj != HCShapeLineObj.sloNone;
            if (Active)
            {
                this.Resizing = (e.Button == MouseButtons.Left) &&
                                ((FShapeLine.ActiveObj == HCShapeLineObj.sloStart) || (FShapeLine.ActiveObj == HCShapeLineObj.sloEnd));

                if (this.Resizing)
                {
                    this.FResizeX = e.X;
                    this.FResizeY = e.Y;

                    // 缩放前的Rect的LeftTop
                    if (FShapeLine.StartPt.X < FShapeLine.EndPt.X)
                    {
                        FLeftTop.X = FShapeLine.StartPt.X;
                    }
                    else
                    {
                        FLeftTop.X = FShapeLine.EndPt.X;
                    }

                    if (FShapeLine.StartPt.Y < FShapeLine.EndPt.Y)
                    {
                        FLeftTop.Y = FShapeLine.StartPt.Y;
                    }
                    else
                    {
                        FLeftTop.Y = FShapeLine.EndPt.Y;
                    }
                }
            }

            return(vResult);
        }