summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2013-12-01 15:05:35 +0100
committerDavid Lamparter <equinox@diac24.net>2013-12-01 15:05:35 +0100
commit89a838c7180835fd32072d98f8554a09786a1e8d (patch)
tree67309f16dc8e9f2f6aee34ce845d81fb31d001be
parent7d0d8794e41330d94758aea810e6549ee3f96160 (diff)
fix some layout bugs
-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