From f3fa6690c17c50e805b618bb2c364d19b99e9ef8 Mon Sep 17 00:00:00 2001 From: Mario Voigt Date: Mon, 27 Sep 2021 23:26:52 +0200 Subject: [PATCH] make applytransform independent from px unit --- .../apply_transformations/apply_transformations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/fablabchemnitz/apply_transformations/apply_transformations.py b/extensions/fablabchemnitz/apply_transformations/apply_transformations.py index c90b80ef..57b917fb 100644 --- a/extensions/fablabchemnitz/apply_transformations/apply_transformations.py +++ b/extensions/fablabchemnitz/apply_transformations/apply_transformations.py @@ -42,10 +42,10 @@ class ApplyTransformations(inkex.EffectExtension): style = element.attrib.get('style') style = dict(Style.parse_str(style)) update = False - if 'stroke-width' in style: try: - stroke_width = float(style.get('stroke-width').strip().replace("px", "")) + #stroke_width = float(style.get('stroke-width').strip().replace("px", "")) + stroke_width = self.svg.uutounit(style.get('stroke-width').strip()) stroke_width *= math.sqrt(abs(transf.a * transf.d)) style['stroke-width'] = str(stroke_width) update = True