Skip to content

Commit 6daf480

Browse files
committed
Fixes #21
1 parent 4de9a23 commit 6daf480

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Stretch/kiplug/board.py

-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ def To_SVG(self):
321321
else:
322322
svg = base.encode()
323323

324-
print(self.metadata)
325324
return svg
326325

327326

Stretch/kiplug/via.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,16 @@ def __init__(self):
4444

4545

4646
def From_SVG(self, tag):
47-
x = tag['x']
48-
y = tag['y']
49-
self.at = [str(float(x) / pxToMM), str(float(y) / pxToMM)]
47+
x = float(tag['x'])
48+
y = float(tag['y'])
49+
if tag.has_attr('transform'):
50+
transform = tag['transform']
51+
translate = transform[transform.find('translate(') + 10:-1]
52+
translate = translate[0:translate.find(')')]
53+
xt, yt = translate.split(',')
54+
x = (float(xt) + x)
55+
y = (float(yt) + y)
56+
self.at = [str(x / pxToMM), str(y / pxToMM)]
5057

5158
self.size = str(float(tag['size']) / pxToMM)
5259
self.drill = str(float(tag['drill']) / pxToMM)

0 commit comments

Comments
 (0)