From f63f1bb0aa3705671522b626a2395ab02ce97e6e Mon Sep 17 00:00:00 2001 From: Mario Voigt Date: Tue, 30 Nov 2021 02:03:02 +0100 Subject: [PATCH] small fixes --- .../apply_transformations/apply_transformations.py | 9 ++++----- .../box_maker_tabbed.inx | 0 .../box_maker_tabbed.py | 0 .../{boxmaker_tabbed => box_maker_tabbed}/meta.json | 4 ++-- .../schroffmaker.inx | 0 5 files changed, 6 insertions(+), 7 deletions(-) rename extensions/fablabchemnitz/{boxmaker_tabbed => box_maker_tabbed}/box_maker_tabbed.inx (100%) rename extensions/fablabchemnitz/{boxmaker_tabbed => box_maker_tabbed}/box_maker_tabbed.py (100%) rename extensions/fablabchemnitz/{boxmaker_tabbed => box_maker_tabbed}/meta.json (91%) rename extensions/fablabchemnitz/{boxmaker_tabbed => box_maker_tabbed}/schroffmaker.inx (100%) diff --git a/extensions/fablabchemnitz/apply_transformations/apply_transformations.py b/extensions/fablabchemnitz/apply_transformations/apply_transformations.py index 9a2c9244..4a8eb46f 100644 --- a/extensions/fablabchemnitz/apply_transformations/apply_transformations.py +++ b/extensions/fablabchemnitz/apply_transformations/apply_transformations.py @@ -7,6 +7,7 @@ import copy import math from lxml import etree +import re import inkex from inkex.paths import CubicSuperPath, Path from inkex.transforms import Transform @@ -44,13 +45,11 @@ class ApplyTransformations(inkex.EffectExtension): update = False if 'stroke-width' in style: try: - #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)) - #stroke_width *= math.sqrt(abs(transf.a * transf.d - transf.b * transf.c)) + stroke_width = self.svg.unittouu(style.get('stroke-width')) / self.svg.unittouu("1px") + stroke_width *= math.sqrt(abs(transf.a * transf.d - transf.b * transf.c)) style['stroke-width'] = str(stroke_width) update = True - except AttributeError: + except AttributeError as e: pass if update: diff --git a/extensions/fablabchemnitz/boxmaker_tabbed/box_maker_tabbed.inx b/extensions/fablabchemnitz/box_maker_tabbed/box_maker_tabbed.inx similarity index 100% rename from extensions/fablabchemnitz/boxmaker_tabbed/box_maker_tabbed.inx rename to extensions/fablabchemnitz/box_maker_tabbed/box_maker_tabbed.inx diff --git a/extensions/fablabchemnitz/boxmaker_tabbed/box_maker_tabbed.py b/extensions/fablabchemnitz/box_maker_tabbed/box_maker_tabbed.py similarity index 100% rename from extensions/fablabchemnitz/boxmaker_tabbed/box_maker_tabbed.py rename to extensions/fablabchemnitz/box_maker_tabbed/box_maker_tabbed.py diff --git a/extensions/fablabchemnitz/boxmaker_tabbed/meta.json b/extensions/fablabchemnitz/box_maker_tabbed/meta.json similarity index 91% rename from extensions/fablabchemnitz/boxmaker_tabbed/meta.json rename to extensions/fablabchemnitz/box_maker_tabbed/meta.json index 234294f3..abcffeaa 100644 --- a/extensions/fablabchemnitz/boxmaker_tabbed/meta.json +++ b/extensions/fablabchemnitz/box_maker_tabbed/meta.json @@ -1,8 +1,8 @@ [ { "name": "Box Maker - ", - "id": "fablabchemnitz.de.boxmaker_tabbed.", - "path": "boxmaker_tabbed", + "id": "fablabchemnitz.de.box_maker_tabbed.", + "path": "box_maker_tabbed", "dependent_extensions": null, "original_name": [ "Schroff Box Maker", diff --git a/extensions/fablabchemnitz/boxmaker_tabbed/schroffmaker.inx b/extensions/fablabchemnitz/box_maker_tabbed/schroffmaker.inx similarity index 100% rename from extensions/fablabchemnitz/boxmaker_tabbed/schroffmaker.inx rename to extensions/fablabchemnitz/box_maker_tabbed/schroffmaker.inx