Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-03-21 02:59:38 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-03-21 02:59:38 +0300
commit795844bb2ffabb16a6498fa6e42153debc826605 (patch)
tree6b9cb92cb5b02fa9853a042c795e3b648561a954 /io_curve_svg
parenta39e8e5fc1641ab003d4374a0a2649a0bfbe5b9f (diff)
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
Diffstat (limited to 'io_curve_svg')
-rw-r--r--io_curve_svg/import_svg.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/io_curve_svg/import_svg.py b/io_curve_svg/import_svg.py
index c39f8efa..d68c1113 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()