private void EndRegionSelection() { bool wasCreating = IsCreating; bool wasMoving = IsMoving; IsCreating = false; IsMoving = false; Form.SetDefaultCursor(); BaseShape shape = CurrentShape; if (shape != null) { if (!shape.IsValidShape) { shape.Rectangle = Rectangle.Empty; UpdateCurrentHoverShape(); if (IsCurrentHoverShapeValid) { shape.Rectangle = CurrentHoverShape.Rectangle; } else { DeleteCurrentShape(); shape = null; } } if (shape != null) { if (Options.QuickCrop && IsCurrentShapeTypeRegion) { Form.UpdateRegionPath(); Form.Close(RegionResult.Region); } else { if (wasCreating) { shape.OnCreated(); shape.InitialSize = shape.Rectangle.Size; OnShapeCreated(shape); } else if (wasMoving) { shape.OnMoved(); } SelectCurrentShape(); } } } }
private void EndRegionSelection() { bool wasCreating = IsCreating; IsCreating = false; IsMoving = false; BaseShape shape = CurrentShape; if (shape != null) { if (!shape.IsValidShape) { shape.Rectangle = Rectangle.Empty; CheckHover(); if (IsCurrentHoverShapeValid) { shape.Rectangle = CurrentHoverShape.Rectangle; } else { DeleteCurrentShape(); shape = null; } } if (shape != null) { if (Config.QuickCrop && IsCurrentShapeTypeRegion) { form.UpdateRegionPath(); form.Close(RegionResult.Region); } else { if (wasCreating) { shape.OnCreated(); OnShapeCreated(shape); } SelectCurrentShape(); } } } }