From 52484b0d55226eac505f34a6eaf0de9f655f8512 Mon Sep 17 00:00:00 2001 From: Florian Festi Date: Sun, 1 Sep 2019 15:26:31 +0200 Subject: [PATCH] adjustSize(): add support for edge chars --- boxes/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/boxes/__init__.py b/boxes/__init__.py index 69fd1d1..65bb8cb 100755 --- a/boxes/__init__.py +++ b/boxes/__init__.py @@ -522,6 +522,10 @@ class Boxes: self.addPart(parts.Parts(self)) def adjustSize(self, l, e1=True, e2=True): + # Char to edge object + e1 = self.edges.get(e1, e1) + e2 = self.edges.get(e2, e2) + try: total = sum(l) walls = (len(l) - 1) * self.thickness @@ -535,7 +539,7 @@ class Boxes: walls += self.thickness if isinstance(e2, edges.BaseEdge): - walls += e2.startwidth + e2.margin() + walls += e2.startwidth() + e2.margin() elif e2: walls += self.thickness