From d61b86caa757040282111efb65eacda57c61bb52 Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Fri, 21 Aug 2015 00:05:48 +0200 Subject: [PATCH] Slight change to how the zoomed font is calculated. This just seems to give a more natural size when zooming over the previous. Can be reverted if people don't like it. Also using this as a sneaky way to close 6 year old bug. --- terminatorlib/terminal.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index 1ac890fb..203c1bea 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -1263,11 +1263,10 @@ class Terminal(gtk.VBox): dbg('Terminal::zoom_scale: One axis unchanged, not scaling') return - old_area = old_data['old_columns'] * old_data['old_rows'] - new_area = new_columns * new_rows - area_factor = (new_area / old_area) / 2 + scale_factor = min ( (new_columns / old_data['old_columns'] * 0.97), + (new_rows / old_data['old_rows'] * 1.05) ) - new_size = int(old_data['old_font'].get_size() * area_factor) + new_size = int(old_data['old_font'].get_size() * scale_factor) if new_size == 0: err('refusing to set a zero sized font') return