From 8a90840db2cf4fca6113e1ed2ed630d22e3c9e67 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sat, 11 Feb 2017 18:14:03 +0100 Subject: [PATCH] SKSvg - Fixed SVG not loaded when viewvport / viewbox not specified --- source/SkiaSharp.Svg/SkiaSharp.Svg.Shared/SKSvg.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/SkiaSharp.Svg/SkiaSharp.Svg.Shared/SKSvg.cs b/source/SkiaSharp.Svg/SkiaSharp.Svg.Shared/SKSvg.cs index 58a70d1b..ee5e9cb2 100644 --- a/source/SkiaSharp.Svg/SkiaSharp.Svg.Shared/SKSvg.cs +++ b/source/SkiaSharp.Svg/SkiaSharp.Svg.Shared/SKSvg.cs @@ -93,6 +93,15 @@ namespace SkiaSharp { ViewBox = ReadRectangle(viewBoxA.Value); } + else + { + var widthA = svg.Attribute("width"); + var heightA = svg.Attribute("height"); + var width = ReadNumber(widthA); + var height = ReadNumber(heightA); + var size = new SKSize(width, height); + ViewBox = SKRect.Create(size); + } if (CanvasSize.IsEmpty) {