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-20 11:52:18 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-03-20 11:52:18 +0300
commit97b21507bd4288c6566fca3f533c8040e523b203 (patch)
tree02f0f80fa65d7d918368d1aa06903e85f3fea030 /io_curve_svg
parent5dda667bdf12534699539acbe473895f3dc26ee4 (diff)
fix for 2 bugs importing SVG
- transform() only requires a single argument. - support 'INVALID' as a unit suffix is present in some files created by docbook.
Diffstat (limited to 'io_curve_svg')
-rw-r--r--io_curve_svg/import_svg.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/io_curve_svg/import_svg.py b/io_curve_svg/import_svg.py
index 3881a619..3122df91 100644
--- a/io_curve_svg/import_svg.py
+++ b/io_curve_svg/import_svg.py
@@ -29,16 +29,18 @@ from . import svg_colors
#### Common utilities ####
-# TODO: 'em' and 'ex' aren't actually supported
-SVGUnits = {'': 1.0,
- 'px': 1.0,
- 'in': 90,
- 'mm': 90 / 25.4,
- 'cm': 90 / 2.54,
- 'pt': 1.25,
- 'pc': 15.0,
- 'em': 1.0,
- 'ex': 1.0}
+# TODO: "em" and "ex" aren't actually supported
+SVGUnits = {"": 1.0,
+ "px": 1.0,
+ "in": 90,
+ "mm": 90 / 25.4,
+ "cm": 90 / 2.54,
+ "pt": 1.25,
+ "pc": 15.0,
+ "em": 1.0,
+ "ex": 1.0,
+ "INVALID": 1.0, # some DocBook files contain this
+ }
SVGEmptyStyles = {'useFill': None,
'fill': None}
@@ -289,7 +291,7 @@ def SVGTransformTranslate(params):
"""
tx = float(params[0])
- ty = float(params[1])
+ ty = float(params[1]) if len(params) > 1 else 0.0
return Matrix.Translation(Vector((tx, ty, 0.0)))