PurplePen.RectangleSelectMode.LeftButtonDrag C# (CSharp) Method

LeftButtonDrag() public method

public LeftButtonDrag ( Pane pane, PointF location, PointF locationStart, float pixelSize, bool &displayUpdateNeeded ) : void
pane Pane
location PointF
locationStart PointF
pixelSize float
displayUpdateNeeded bool
return void
        public override void LeftButtonDrag(Pane pane, PointF location, PointF locationStart, float pixelSize, ref bool displayUpdateNeeded)
        {
            Debug.Assert(pane == Pane.Map);

            if (draggingWhole) {
                // Update the rectangle being dragged.
                selectingCourseObj = (SelectingRectangleCourseObj) dragStartCourseObj.Clone();
                selectingCourseObj.Offset(location.X - startDrag.X, location.Y - startDrag.Y);
            }
            else if (draggingHandle) {
                // Update the rectangle where the handle is being dragged.
                selectingCourseObj = (SelectingRectangleCourseObj) dragStartCourseObj.Clone();
                PointF newHandleLocation = new PointF(handleDrag.X + location.X - startDrag.X, handleDrag.Y + location.Y - startDrag.Y);
                selectingCourseObj.MoveHandle(handleDrag, newHandleLocation);
            }

            displayUpdateNeeded = true;
        }