summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2020-04-01 18:52:39 +0200
committerGitHub <noreply@github.com>2020-04-01 18:52:39 +0200
commit7dcd04cc9138f71bd441d7dcfa2a429625c67b19 (patch)
tree82474cbdd452c7abc8c14d43d64f0d95199eb039
parentfacf1817927be7e0905dc398aa53464a4f244826 (diff)
preserve aspect ratio (#646)
-rw-r--r--lib/svg/units.py6
1 files changed, 0 insertions, 6 deletions
diff --git a/lib/svg/units.py b/lib/svg/units.py
index d97ea418..319e018b 100644
--- a/lib/svg/units.py
+++ b/lib/svg/units.py
@@ -3,7 +3,6 @@ import simpletransform
from ..i18n import _
from ..utils import cache
-
# modern versions of Inkscape use 96 pixels per inch as per the CSS standard
PIXELS_PER_MM = 96 / 25.4
@@ -131,11 +130,6 @@ def get_viewbox_transform(node):
# preserve aspect ratio
aspect_ratio = node.get('preserveAspectRatio', 'xMidYMid meet')
if aspect_ratio != 'none':
- unit = parse_length_with_units(node.get('width'))[1]
- if float(viewbox[2]) > parse_length_with_units(node.get('width'))[0]:
- sx = convert_length(viewbox[2] + unit) / float(viewbox[2]) if 'slice' in aspect_ratio else 1.0
- if float(viewbox[3]) > parse_length_with_units(node.get('height'))[0]:
- sy = convert_length(viewbox[3] + unit) / float(viewbox[3]) if 'slice' in aspect_ratio else 1.0
sx = sy = max(sx, sy) if 'slice' in aspect_ratio else min(sx, sy)
scale_transform = simpletransform.parseTransform("scale(%f, %f)" % (sx, sy))