From 2c98306dffee5575151d395989beb5e870c6c05b Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Thu, 9 Apr 2020 13:40:19 -1000 Subject: [PATCH] add update_height parameter to Nodegrid.place_node --- hecl/blender/hecl/Nodegrid.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hecl/blender/hecl/Nodegrid.py b/hecl/blender/hecl/Nodegrid.py index b7d7049eb..d43395adb 100644 --- a/hecl/blender/hecl/Nodegrid.py +++ b/hecl/blender/hecl/Nodegrid.py @@ -28,7 +28,7 @@ class Nodegrid: frame_node.color = FRAME_COLORS[i] self.frames.append(frame_node) - def place_node(self, node, col): + def place_node(self, node, col, update_height = True): if col < 0 or col >= self.ncol: return False @@ -37,8 +37,9 @@ class Nodegrid: x_pos += FRAME_WIDTHS[i] + NODE_PADDING*2 node.location[0] = x_pos - TOTAL_WIDTH/2 node.location[1] = self.heights[col] - self.heights[col] -= node.height + NODE_PADDING - self.frames[col].height += node.height + NODE_PADDING + if update_height: + self.heights[col] -= node.height + NODE_PADDING + self.frames[col].height += node.height + NODE_PADDING node.parent = self.frames[col] return True