mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-07-05 23:15:52 +00:00
add update_height parameter to Nodegrid.place_node
This commit is contained in:
parent
81c5750c44
commit
2c98306dff
@ -28,7 +28,7 @@ class Nodegrid:
|
|||||||
frame_node.color = FRAME_COLORS[i]
|
frame_node.color = FRAME_COLORS[i]
|
||||||
self.frames.append(frame_node)
|
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:
|
if col < 0 or col >= self.ncol:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@ -37,6 +37,7 @@ class Nodegrid:
|
|||||||
x_pos += FRAME_WIDTHS[i] + NODE_PADDING*2
|
x_pos += FRAME_WIDTHS[i] + NODE_PADDING*2
|
||||||
node.location[0] = x_pos - TOTAL_WIDTH/2
|
node.location[0] = x_pos - TOTAL_WIDTH/2
|
||||||
node.location[1] = self.heights[col]
|
node.location[1] = self.heights[col]
|
||||||
|
if update_height:
|
||||||
self.heights[col] -= node.height + NODE_PADDING
|
self.heights[col] -= node.height + NODE_PADDING
|
||||||
self.frames[col].height += node.height + NODE_PADDING
|
self.frames[col].height += node.height + NODE_PADDING
|
||||||
node.parent = self.frames[col]
|
node.parent = self.frames[col]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user