From 795844bb2ffabb16a6498fa6e42153debc826605 Mon Sep 17 00:00:00 2001
From: Campbell Barton <ideasman42@gmail.com>
Date: Sun, 20 Mar 2011 23:59:38 +0000
Subject: [PATCH] fix for loading some svg's with viewBox like this:
 viewBox="0,0 360,240" eg: XFCE file - /usr/share/xfce4/xkb/flags/tr.svg

---
 io_curve_svg/import_svg.py | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/io_curve_svg/import_svg.py b/io_curve_svg/import_svg.py
index c39f8efa9..d68c1113e 100644
--- a/io_curve_svg/import_svg.py
+++ b/io_curve_svg/import_svg.py
@@ -174,7 +174,7 @@ def SVGRectFromNode(node, context):
     h = context['rect'][1]
 
     if node.getAttribute('viewBox'):
-        viewBox = node.getAttribute('viewBox').split()
+        viewBox = node.getAttribute('viewBox').replace(',', ' ').split()
         w = SVGParseCoord(viewBox[2], w)
         h = SVGParseCoord(viewBox[3], h)
     else:
@@ -212,7 +212,7 @@ def SVGMatrixFromNode(node, context):
         m = m * m.Scale(h / rect[1], 4, Vector((0.0, 1.0, 0.0)))
 
     if node.getAttribute('viewBox'):
-        viewBox = node.getAttribute('viewBox').split()
+        viewBox = node.getAttribute('viewBox').replace(',', ' ').split()
         vx = SVGParseCoord(viewBox[0], w)
         vy = SVGParseCoord(viewBox[1], h)
         vw = SVGParseCoord(viewBox[2], w)
@@ -324,10 +324,8 @@ def SVGTransformScale(params):
     scale SVG transform command
     """
 
-    sx = sy = float(params[0])
-
-    if len(params) > 1:
-        sy = float(params[1])
+    sx = float(params[0])
+    sy = float(params[1]) if len(params) > 1 else sx
 
     m = Matrix()
 
-- 
GitLab