소스 검색

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));