From 0b2e22c4529461f4e73bc28e56d4c40149baabd5 Mon Sep 17 00:00:00 2001 From: Roderik Ploszek Date: Sun, 15 Apr 2018 15:02:16 +0200 Subject: [PATCH] Fix exception when changing games in preview When changing games from Mahjongg to French type with Mahjongg cardset active, an exception would occur. This was caused by 1d43029. --- pysollib/images.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pysollib/images.py b/pysollib/images.py index 7ab56b07..7fde0bd1 100644 --- a/pysollib/images.py +++ b/pysollib/images.py @@ -148,11 +148,11 @@ class Images: # bottoms / letters bottom = None neg_bottom = None - while len(self._bottom_positive) < self.cs.nbottoms: + while len(self._bottom_positive) < max(7, self.cs.nbottoms): if bottom is None: bottom = createImage(cw, ch, fill=None, outline="#000000") self._bottom_positive.append(bottom) - while len(self._bottom_negative) < self.cs.nbottoms: + while len(self._bottom_negative) < max(7, self.cs.nbottoms): if neg_bottom is None: neg_bottom = createImage(cw, ch, fill=None, outline="#ffffff") self._bottom_negative.append(neg_bottom)