From cfcd23ffed0000bcb1896e6fd1b4e5778477893d Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Fri, 10 May 2013 01:24:26 +0000 Subject: check for overflow < 1 --- (limited to 'TurtleArtActivity.py') diff --git a/TurtleArtActivity.py b/TurtleArtActivity.py index 976d79a..4cd1e80 100644 --- a/TurtleArtActivity.py +++ b/TurtleArtActivity.py @@ -815,9 +815,8 @@ class TurtleArtActivity(activity.Activity): if len(palette_names) > max_palettes: max_palettes -= 1 # Make room for the palette button overflow = len(palette_names) - max_palettes - if overflow < 0: - overflow = 1 # Force overflow to be positive - if gtk.gdk.screen_width() - style.GRID_CELL_SIZE < \ + if overflow < 1 or \ + gtk.gdk.screen_width() - style.GRID_CELL_SIZE < \ int(overflow * (style.GRID_CELL_SIZE + 2)): width = gtk.gdk.screen_width() - style.GRID_CELL_SIZE height = int(style.GRID_CELL_SIZE * 1.5) -- cgit v0.9.1