Explorar o código

restore selection tool after deleting selection

Johann ELSASS %!s(int64=3) %!d(string=hai) anos
pai
achega
25511a7434
Modificáronse 1 ficheiros con 6 adicións e 3 borrados
  1. 6 3
      lazpaint/image/uimageaction.pas

+ 6 - 3
lazpaint/image/uimageaction.pas

@@ -1541,10 +1541,12 @@ end;
 
 procedure TImageActions.DeleteSelection;
 var LayerAction: TLayerAction;
-  doErase: Boolean;
+  doErase, wasSelecting: Boolean;
 begin
   if image.SelectionMaskEmpty then exit;
-  if not image.CheckNoAction then exit;
+  wasSelecting := ToolManager.GetCurrentToolType in [ptSelectPen..ptSelectSpline];
+  if wasSelecting then ToolManager.ToolCloseDontReopen
+  else if not image.CheckNoAction then exit;
   LayerAction := nil;
   try
     doErase := Image.SelectionLayerIsEmpty;
@@ -1557,7 +1559,8 @@ begin
       FInstance.ShowError('DeleteSelection',ex.Message);
   end;
   LayerAction.Free;
-  if (CurrentTool = ptRotateSelection) or
+  if wasSelecting then ToolManager.ToolOpen
+  else if (CurrentTool = ptRotateSelection) or
      (CurrentTool = ptMoveSelection) then
     ChooseTool(ptHand);
 end;