From 7eff50ac82972383a09a9ee7cae8e0cb7cd7c822 Mon Sep 17 00:00:00 2001 From: ubbn Date: Tue, 28 Jul 2015 12:19:57 +0200 Subject: [PATCH] Allowed negative coordinates. Fix to #174 --- Source/Document Structure/SvgFragment.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Document Structure/SvgFragment.cs b/Source/Document Structure/SvgFragment.cs index ef8c813..6ca9b0a 100644 --- a/Source/Document Structure/SvgFragment.cs +++ b/Source/Document Structure/SvgFragment.cs @@ -244,12 +244,13 @@ namespace Svg else { bounds = this.Bounds; //do just one call to the recursive bounds property + this.ViewBox = new SvgViewBox(bounds.X, bounds.Y, bounds.Width, bounds.Height); } } if (isWidthperc) { - w = (bounds.Width + bounds.X) * (Width.Value * 0.01f); + w = (bounds.Width) * (Width.Value * 0.01f); } else { @@ -257,7 +258,7 @@ namespace Svg } if (isHeightperc) { - h = (bounds.Height + bounds.Y) * (Height.Value * 0.01f); + h = (bounds.Height) * (Height.Value * 0.01f); } else { -- GitLab