diff options
-rw-r--r-- | io_curve_svg/import_svg.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/io_curve_svg/import_svg.py b/io_curve_svg/import_svg.py index 7079d3f9..9bc48a21 100644 --- a/io_curve_svg/import_svg.py +++ b/io_curve_svg/import_svg.py @@ -1816,12 +1816,10 @@ class SVGGeometrySVG(SVGGeometryContainer): matrix = self.getNodeMatrix() - # Better Inkscape compatibility: match document origin with - # 3D space origin. - if self._node.getAttribute('inkscape:version'): - raw_height = self._node.getAttribute('height') - document_height = SVGParseCoord(raw_height, 1.0) - matrix = matrix @ matrix.Translation([0.0, -document_height , 0.0]) + # match document origin with 3D space origin. + if self._node.getAttribute('viewBox'): + viewbox = parse_array_of_floats(self._node.getAttribute('viewBox')) + matrix = matrix @ matrix.Translation([0.0, - viewbox[1] - viewbox[3], 0.0]) self._pushMatrix(matrix) self._pushRect(rect) |