summaryrefslogtreecommitdiff
path: root/ptlayout.py
diff options
context:
space:
mode:
Diffstat (limited to 'ptlayout.py')
-rw-r--r--ptlayout.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/ptlayout.py b/ptlayout.py
index 6c3d858..0850c62 100644
--- a/ptlayout.py
+++ b/ptlayout.py
@@ -113,7 +113,7 @@ class PTLQRCode(PTLayoutElem):
cctx.fill()
cctx.set_source_rgba(0.0, 0.0, 0.0, 1.0)
- return bpp * qmlen
+ return bpp * qmlen + self.hborder * 2
class PTLContainer(PTLayoutElem):
def __init__(self):
@@ -132,7 +132,9 @@ class PTLHSeq(PTLContainer):
self.spacing = 5
def prep_size(self, hh):
- w, h = len(self._children) * self.spacing, 0
+ if len(self._children) == 0:
+ return (0,0)
+ w, h = (len(self._children) - 1) * self.spacing, 0
for k in self._children:
cw, ch = k.prep_size(hh)
w += cw