Commit 6daf480 1 parent 4de9a23 commit 6daf480 Copy full SHA for 6daf480
File tree 2 files changed +10
-4
lines changed
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -321,7 +321,6 @@ def To_SVG(self):
321
321
else :
322
322
svg = base .encode ()
323
323
324
- print (self .metadata )
325
324
return svg
326
325
327
326
Original file line number Diff line number Diff line change @@ -44,9 +44,16 @@ def __init__(self):
44
44
45
45
46
46
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 )]
50
57
51
58
self .size = str (float (tag ['size' ]) / pxToMM )
52
59
self .drill = str (float (tag ['drill' ]) / pxToMM )
You can’t perform that action at this time.
0 commit comments