Browse Source

Fixed not clamped size

Krzysztof Krysiński 1 year ago
parent
commit
8548eb802e

+ 1 - 1
src/PixiEditor.AvaloniaUI/Models/DocumentModels/DocumentUpdater.cs

@@ -281,7 +281,7 @@ internal class DocumentUpdater
         {
             surf.Dispose();
             VecI size = (VecI)(info.Size * res.Multiplier());
-            doc.Surfaces[res] = new Surface(size); //TODO: Bgra8888 was here
+            doc.Surfaces[res] = new Surface(new VecI(Math.Max(size.X, 1), Math.Max(size.Y, 1))); //TODO: Bgra8888 was here
         }
 
         doc.SetSize(info.Size);