From ca3f76f3b86b9e0bcb722bafa84830eb874f314a Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Wed, 15 Feb 2023 06:58:04 -0300 Subject: [PATCH] [SVG][KiCad 7] Fixed viewbox adjust - Must be float values as they are mm now --- kibot/out_svg.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/kibot/out_svg.py b/kibot/out_svg.py index c81edc00..426274d0 100644 --- a/kibot/out_svg.py +++ b/kibot/out_svg.py @@ -83,12 +83,15 @@ class SVGOptions(DrillMarks): # Scale factor to convert KiCad IU to the SVG units if GS.ki5: mult = KICAD5_SVG_SCALE + # View port in SVG units + bbox = tuple(map(lambda x: int(x*mult), bbox)) elif GS.ki7: - mult = GS.to_mm(1) + # View port in SVG units + bbox = tuple(map(lambda x: GS.to_mm(x), bbox)) else: mult = 10.0 ** (self.svg_precision - 6) - # View port in SVG units - bbox = tuple(map(lambda x: int(x*mult), bbox)) + # View port in SVG units + bbox = tuple(map(lambda x: int(x*mult), bbox)) logger.debug('Adjusting SVG viewBox to {} for width {} cm and height {} cm'.format(bbox, width, height)) for f in self._generated_files.values(): fname = os.path.join(output_dir, f)