From 9ac5f913fa574cdb556399782e6c75a329df04fe Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Mon, 1 Feb 2010 20:15:53 +0000 Subject: [PATCH] Ensure we don't set a zero sized font when zooming. Doing so causes vte to explode --- terminatorlib/terminal.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index 3d4e90cb..4b42cf04 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -3,6 +3,7 @@ # GPL v2 only """terminal.py - classes necessary to provide Terminal widgets""" +from __future__ import division import sys import os import signal @@ -969,7 +970,12 @@ for %s (%s)' % (name, urlplugin.__class__.__name__)) new_area = new_columns * new_rows area_factor = (new_area / old_area) / 2 - new_font.set_size(old_data['old_font'].get_size() * area_factor) + new_size = int(old_data['old_font'].get_size() * area_factor) + if new_size == 0: + dbg('refusing to set a zero sized font') + return + new_font.set_size(new_size) + dbg('setting new font: %s' % new_font) self.vte.set_font(new_font) def is_zoomed(self):