From 574f72e6e48097d8e456f764c116eec25d09fe22 Mon Sep 17 00:00:00 2001 From: Florian Festi Date: Tue, 12 Jul 2022 22:10:59 +0200 Subject: [PATCH] DividerTray: Fix height if "outside" and "bottom" is selected Thanks to https://github.com/nialabert for reporting! Resolves: #413 --- boxes/generators/dividertray.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/boxes/generators/dividertray.py b/boxes/generators/dividertray.py index 968c0ad..3aafe70 100644 --- a/boxes/generators/dividertray.py +++ b/boxes/generators/dividertray.py @@ -112,8 +112,11 @@ class DividerTray(Boxes): if side_walls_number == 0: raise ValueError("You need at least one side wall to generate this tray") - # If measures are inside, we need to adjust height before slot generation - if not self.outside: + # We need to adjust height before slot generation + if self.outside: + if self.bottom: + self.h -= self.thickness + else: # If the parameter 'h' is the inner height of the content itself, # then the actual tray height needs to be adjusted with the angle self.h = self.h * math.cos(math.radians(self.Slot_angle))