Skip to content

Commit 5798d1d

Browse files
committed
fix some bug
1 parent b7b1f38 commit 5798d1d

File tree

6 files changed

+266
-2210
lines changed

6 files changed

+266
-2210
lines changed

NodeGraphQt/base/node.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ def set_name(self, name=''):
184184
Args:
185185
name (str): name for the node.
186186
"""
187+
if self._graph is not None and not self._graph.editable:
188+
self.view.name = self.model.name
189+
return
187190
self.set_property('name', name)
188191

189192
def color(self):

NodeGraphQt/base/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ def _bg_grid_lines(graph):
292292

293293

294294
def __layout_graph(graph, down_stream=True):
295+
graph.begin_undo('Auto Layout')
295296
node_space = graph.get_node_space()
296297
if node_space is not None:
297298
nodes = node_space.children()
@@ -309,6 +310,7 @@ def __layout_graph(graph, down_stream=True):
309310
dx = nodes_center0[0] - nodes_center1[0]
310311
dy = nodes_center0[1] - nodes_center1[1]
311312
[n.set_pos(n.x_pos() + dx, n.y_pos()+dy) for n in nodes]
313+
graph.end_undo()
312314

313315

314316
def _layout_graph_down(graph):

example_auto_nodes/data_node.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def run(self):
3030
value = self.getInputData(0)
3131
if type(value) is not list:
3232
self.error("Input data not list")
33+
return
3334
for index, data in enumerate(value):
3435
if index > 3:
3536
return

0 commit comments

Comments
 (0)