From a3b062a90ae0d72a7f87a8809e0db03f949acc0d Mon Sep 17 00:00:00 2001 From: Kristoffer Kleine Date: Sun, 17 Jul 2011 23:11:23 +0200 Subject: [PATCH] Prevent an infinite loop when trimming title --- src/chronos/ui/month.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chronos/ui/month.py b/src/chronos/ui/month.py index 3fd7605..1823a81 100644 --- a/src/chronos/ui/month.py +++ b/src/chronos/ui/month.py @@ -379,7 +379,7 @@ def draw_line(ctx, x1, y1, x2, y2): title = event.title t_width = get_text_extents(ctx, title)[2] - while t_width > space: + while t_width > space and len(title) > 1: title = title[:-1] t_width = get_text_extents(ctx, title)[2]