From b22f862b9407f02bb4cbd66746c895befd609686 Mon Sep 17 00:00:00 2001 From: Mario Voigt Date: Mon, 17 Aug 2020 13:03:09 +0200 Subject: [PATCH] Fix living hinge --- extensions/fablabchemnitz_living_hinge.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/extensions/fablabchemnitz_living_hinge.py b/extensions/fablabchemnitz_living_hinge.py index c42c5998..ba006af9 100644 --- a/extensions/fablabchemnitz_living_hinge.py +++ b/extensions/fablabchemnitz_living_hinge.py @@ -78,16 +78,13 @@ class HingeCuts(inkex.Effect): # inkex.utils.debug("id:" + id) # for key in node.attrib.keys(): # inkex.utils.debug(key + ": " + node.get(key)) - x = float(node.get("x")) - dx = float(node.get("width")) - y = float(node.get("y")) - dy = float(node.get("height")) - + bbox = node.bounding_box() + # calculate the cut lines for the hinge if (dir=="y"): - lines, l_actual, d_actual, dd_actual = self.calcYCutLines(x, y, dx, dy, l, d, dd) + lines, l_actual, d_actual, dd_actual = self.calcYCutLines(bbox.left, bbox.top, bbox.width, bbox.height, l, d, dd) else: - lines, l_actual, d_actual, dd_actual = self.calcXCutLines(x, y, dx, dy, l, d, dd) + lines, l_actual, d_actual, dd_actual = self.calcXCutLines(bbox.left, bbox.top, bbox.width, bbox.height, l, d, dd) s = '' for line in lines: