Browse Source

fix apply selection transform

Unknown 6 years ago
parent
commit
61b270c349
1 changed files with 7 additions and 2 deletions
  1. 7 2
      lazpaint/ulayeraction.pas

+ 7 - 2
lazpaint/ulayeraction.pas

@@ -496,6 +496,7 @@ procedure TLayerAction.ApplySelectionTransform(ApplyToMask: boolean);
 var
 var
   newBmp: TBGRABitmap;
   newBmp: TBGRABitmap;
   newLeft, newTop: integer;
   newLeft, newTop: integer;
+  r: TRect;
 begin
 begin
   if not IsAffineMatrixIdentity(CurrentState.SelectionTransform) then
   if not IsAffineMatrixIdentity(CurrentState.SelectionTransform) then
   begin
   begin
@@ -503,7 +504,9 @@ begin
     begin
     begin
       NeedSelectionMaskBackup;
       NeedSelectionMaskBackup;
       CurrentState.ComputeTransformedSelectionMask(newBmp,newLeft,newTop);
       CurrentState.ComputeTransformedSelectionMask(newBmp,newLeft,newTop);
-      CurrentState.SelectionMask.FillRect(CurrentState.GetSelectionMaskBounds, BGRABlack, dmSet);
+      r := CurrentState.GetSelectionMaskBounds;
+      CurrentState.SelectionMask.FillRect(r, BGRABlack, dmSet);
+      NotifyChange(CurrentState.SelectionMask, r);
       CurrentState.SelectionMask.PutImage(newLeft,newTop,newBmp,dmSet);
       CurrentState.SelectionMask.PutImage(newLeft,newTop,newBmp,dmSet);
       newBmp.Free;
       newBmp.Free;
       CurrentState.DiscardSelectionMaskBounds;
       CurrentState.DiscardSelectionMaskBounds;
@@ -512,7 +515,9 @@ begin
     begin
     begin
       NeedSelectionLayerBackup;
       NeedSelectionLayerBackup;
       CurrentState.ComputeTransformedSelectionLayer(newBmp,newLeft,newTop);
       CurrentState.ComputeTransformedSelectionLayer(newBmp,newLeft,newTop);
-      CurrentState.SelectionLayer.FillRect(CurrentState.GetSelectionLayerBounds, BGRABlack, dmSet);
+      r := CurrentState.GetSelectionLayerBounds;
+      CurrentState.SelectionLayer.FillRect(r, BGRAPixelTransparent, dmSet);
+      NotifyChange(CurrentState.SelectionLayer, r);
       CurrentState.SelectionLayer.PutImage(newLeft,newTop,newBmp,dmSet);
       CurrentState.SelectionLayer.PutImage(newLeft,newTop,newBmp,dmSet);
       newBmp.Free;
       newBmp.Free;
       CurrentState.DiscardSelectionLayerBounds;
       CurrentState.DiscardSelectionLayerBounds;