From deaf867091d104927ab9c092c56741ffc9071a98 Mon Sep 17 00:00:00 2001 From: The_miro Date: Thu, 16 Jul 2026 15:48:41 +0200 Subject: [PATCH] Swap preview box dimensions to landscape in A4 mode The printed page is rotated 90 degrees before hitting the printer in A4 mode, so the live-preview box should reflect that same landscape swap instead of sizing itself to the printer's raw portrait grid. Co-Authored-By: Claude Sonnet 5 --- photobooth.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/photobooth.py b/photobooth.py index bbd514c..b31f899 100755 --- a/photobooth.py +++ b/photobooth.py @@ -192,6 +192,12 @@ def box_dims_for(term_rows, term_cols, cfg=None): if cfg is None or not cfg.real_viewfinder: return max_rows, max_cols target_cols, target_rows = output_target_dims(cfg, max_cols - 2, max_rows - 2) + if cfg.printer_a4 and target_rows is not None: + # The printed page is rotated 90 degrees before it reaches the + # printer (see prepare_print_frame), so the box shown on screen + # should reflect that same landscape swap rather than the + # printer's raw portrait character grid. + target_cols, target_rows = target_rows, target_cols rows = max_rows if target_rows is None else max(min(target_rows + 2, max_rows), 3) cols = max(min(target_cols + 2, max_cols), 10) return rows, cols