summaryrefslogtreecommitdiff
path: root/gerbonara
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2022-06-21 12:07:13 +0200
committerjaseg <git@jaseg.de>2022-06-21 12:07:13 +0200
commitee233317f1c5541a302c4f062b9957ae7ea335c2 (patch)
tree9c8f5ea85ba86479c9b5dbf00c3849a0a039e527 /gerbonara
parent6752dab1254e2995e4d8545e2ae95be7be085a40 (diff)
downloadgerbonara-ee233317f1c5541a302c4f062b9957ae7ea335c2.tar.gz
gerbonara-ee233317f1c5541a302c4f062b9957ae7ea335c2.tar.bz2
gerbonara-ee233317f1c5541a302c4f062b9957ae7ea335c2.zip
Fix local testsv0.10.9
Diffstat (limited to 'gerbonara')
-rw-r--r--gerbonara/tests/image_support.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/gerbonara/tests/image_support.py b/gerbonara/tests/image_support.py
index 0c47c8b..8941f82 100644
--- a/gerbonara/tests/image_support.py
+++ b/gerbonara/tests/image_support.py
@@ -151,8 +151,12 @@ def svg_soup(filename):
f.write(str(soup))
def cleanup_gerbv_svg(soup):
- soup.svg['width'] = f'{float(soup.svg["width"])/72*25.4:.4f}mm'
- soup.svg['height'] = f'{float(soup.svg["height"])/72*25.4:.4f}mm'
+ width = soup.svg["width"]
+ height = soup.svg["height"]
+ width = width[:-2] if width.endswith('pt') else width
+ height = height[:-2] if height.endswith('pt') else height
+ soup.svg['width'] = f'{float(width)/72*25.4:.4f}mm'
+ soup.svg['height'] = f'{float(height)/72*25.4:.4f}mm'
for group in soup.find_all('g'):
# gerbv uses Cairo's SVG canvas. Cairo's SVG canvas is kind of broken. It has no support for unit
# handling at all, which means the output files just end up being in pixels at 72 dpi. Further, it