瀏覽代碼

Bounds check

Krzysztof Krysiński 5 月之前
父節點
當前提交
ac76951638
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/PixiEditor/ViewModels/Document/DocumentViewModel.Serialization.cs

+ 1 - 1
src/PixiEditor/ViewModels/Document/DocumentViewModel.Serialization.cs

@@ -584,7 +584,7 @@ internal partial class DocumentViewModel
 
         DrawingSurface surface = null;
 
-        if (bounds != null)
+        if (bounds != null && bounds.Value.Width > 0 && bounds.Value.Height > 0)
         {
             surface = DrawingBackendApi.Current.SurfaceImplementation.Create(
                 new ImageInfo(bounds.Value.Width, bounds.Value.Height));