/// <summary> /// Right mouse button is released /// </summary> /// <param name="control"></param> /// <param name="e"></param> public override void OnMouseUp(MapControl control, MouseEventArgs e) { if (selectMode == SelectionMode.NetSelection) { // Remove old selection rectangle ControlPaint.DrawReversibleFrame( control.RectangleToScreen(DrawRectangle.GetNormalizedRectangle(startPoint, lastPoint)), Color.Black, FrameStyle.Dashed); // Make group selection control.Objects.SelectInRectangle( DrawRectangle.GetNormalizedRectangle(startPoint, lastPoint)); } selectMode = SelectionMode.None; if (resizedObject != null) { // after resizing resizedObject.Normalize(); resizedObject = null; } control.Refresh(); if (commandChangeState != null && wasMove) { // Keep state after moving/resizing and add command to history commandChangeState.NewState(control.Objects); control.AddCommandToHistory(commandChangeState); commandChangeState = null; } }
/// <summary> /// Left mouse is released. /// New object is created and resized. /// </summary> /// <param name="control"></param> /// <param name="e"></param> public override void OnMouseUp(MapControl control, MouseEventArgs e) { control.Objects[0].Normalize(); control.AddCommandToHistory(new CommandAdd(control.Objects[0])); control.ActiveTool = TOOL_TYPE.pointer; control.Refresh(); }