diff options
author | jaseg <git@jaseg.de> | 2022-06-21 12:07:13 +0200 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2022-06-21 12:07:13 +0200 |
commit | ee233317f1c5541a302c4f062b9957ae7ea335c2 (patch) | |
tree | 9c8f5ea85ba86479c9b5dbf00c3849a0a039e527 /gerbonara/tests | |
parent | 6752dab1254e2995e4d8545e2ae95be7be085a40 (diff) | |
download | gerbonara-0.10.9.tar.gz gerbonara-0.10.9.tar.bz2 gerbonara-0.10.9.zip |
Fix local testsv0.10.9
Diffstat (limited to 'gerbonara/tests')
-rw-r--r-- | gerbonara/tests/image_support.py | 8 |
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 |