Browse Source

Copy 0 area check

Krzysztof Krysiński 1 month ago
parent
commit
923bfd642e
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/PixiEditor/Models/Controllers/ClipboardController.cs

+ 6 - 0
src/PixiEditor/Models/Controllers/ClipboardController.cs

@@ -147,6 +147,12 @@ internal static class ClipboardController
             copyArea = document.TransformViewModel.Corners.AABBBounds;
         }
 
+        if(copyArea.IsZeroOrNegativeArea || copyArea.HasNaNOrInfinity)
+        {
+            NoticeDialog.Show("SELECTED_AREA_EMPTY", "NOTHING_TO_COPY");
+            return;
+        }
+
         using Surface documentSurface = new Surface(document.SizeBindable);
 
         document.Renderer.RenderDocument(documentSurface.DrawingSurface,