From 6daf480a97bb6729eaebdecf0ab69b67807b66ff Mon Sep 17 00:00:00 2001 From: JarrettR Date: Fri, 15 Mar 2024 16:55:16 -0700 Subject: [PATCH] Fixes #21 --- Stretch/kiplug/board.py | 1 - Stretch/kiplug/via.py | 13 ++++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Stretch/kiplug/board.py b/Stretch/kiplug/board.py index a90da1d..15ac941 100644 --- a/Stretch/kiplug/board.py +++ b/Stretch/kiplug/board.py @@ -321,7 +321,6 @@ def To_SVG(self): else: svg = base.encode() - print(self.metadata) return svg diff --git a/Stretch/kiplug/via.py b/Stretch/kiplug/via.py index 26fda23..b18cdab 100644 --- a/Stretch/kiplug/via.py +++ b/Stretch/kiplug/via.py @@ -44,9 +44,16 @@ def __init__(self): def From_SVG(self, tag): - x = tag['x'] - y = tag['y'] - self.at = [str(float(x) / pxToMM), str(float(y) / pxToMM)] + x = float(tag['x']) + y = float(tag['y']) + if tag.has_attr('transform'): + transform = tag['transform'] + translate = transform[transform.find('translate(') + 10:-1] + translate = translate[0:translate.find(')')] + xt, yt = translate.split(',') + x = (float(xt) + x) + y = (float(yt) + y) + self.at = [str(x / pxToMM), str(y / pxToMM)] self.size = str(float(tag['size']) / pxToMM) self.drill = str(float(tag['drill']) / pxToMM)