From 263b1cf86a0ee8a95fe06b2e64281868dff54403 Mon Sep 17 00:00:00 2001 From: Benedikt Schroeder Date: Mon, 19 Nov 2018 18:11:52 +0100 Subject: [PATCH] Makes sure a surface is not created with a width or height of zero --- src/Skia/Avalonia.Skia/SurfaceRenderTarget.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Skia/Avalonia.Skia/SurfaceRenderTarget.cs b/src/Skia/Avalonia.Skia/SurfaceRenderTarget.cs index 6955cc666f..dcd4b36d56 100644 --- a/src/Skia/Avalonia.Skia/SurfaceRenderTarget.cs +++ b/src/Skia/Avalonia.Skia/SurfaceRenderTarget.cs @@ -137,7 +137,7 @@ namespace Avalonia.Skia { var colorType = PixelFormatHelper.ResolveColorType(format); - return new SKImageInfo(width, height, colorType, SKAlphaType.Premul); + return new SKImageInfo(Math.Max(width, 1), Math.Max(height, 1), colorType, SKAlphaType.Premul); } ///