From 06bb47ea05ded0cab68ce6641a6d59e4dec5583b Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Sun, 12 Jun 2022 15:37:00 -0300 Subject: [PATCH] pcb_print: fixed frame page orientation in GUI mode. --- CHANGELOG.md | 1 + kibot/kicad/patch_svg.py | 10 ++++++---- kibot/out_pcb_print.py | 4 +++- tests/test_plot/test_print_pcb.py | 2 +- tests/yaml_samples/pcb_print_4.kibot.yaml | 1 + 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cfbfaa7c..32f33504 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Problems expanding multiple KiCad variables in the same value. - XML BoM: Fixed problems with fields containing / (#206) - pcb_print: vias processing was disabled. +- pcb_print: frame orientation in GUI mode. ### Changed - KiCad environment variables: more variables detected, native KiCad 6 names, diff --git a/kibot/kicad/patch_svg.py b/kibot/kicad/patch_svg.py index 5e533431..3e3144ad 100644 --- a/kibot/kicad/patch_svg.py +++ b/kibot/kicad/patch_svg.py @@ -13,15 +13,17 @@ from .. import log logger = log.get_logger() -def patch_svg_file(file, remove_bkg=False): +def patch_svg_file(file, remove_bkg=False, is_portrait=False): + """ KiCad always prints in portrait """ logger.debug('Patching SVG file `{}`'.format(file)) with open(file, 'rt') as f: text = f.read() - text = re.sub(r'', '', text) - else: + elif not is_portrait: text = re.sub(r'