From ab750077fabc3a02b2dddb96a2d2eaf2b1d12e23 Mon Sep 17 00:00:00 2001 From: Florian Festi Date: Mon, 28 Aug 2017 23:10:56 +0200 Subject: [PATCH] .partsMatrix(): Do not error out for zero or negative parts count --- boxes/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/boxes/__init__.py b/boxes/__init__.py index 036357d..1cf11d3 100755 --- a/boxes/__init__.py +++ b/boxes/__init__.py @@ -1531,6 +1531,9 @@ class Boxes: def partsMatrix(self, n, width, move, part, *l, **kw): + if n <= 0: + return + rows = n//width + (1 if n % width else 0) if not move: