Skip to content

Commit 6dedd3e

Browse files
fixes the limit box for the prop_list
1 parent 0f82685 commit 6dedd3e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

NodeGraphQt/custom_widgets/properties_bin/node_property_widgets.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -798,14 +798,16 @@ def add_node(self, node):
798798
if self.limit() == 0 or self._lock:
799799
return
800800

801-
rows = self._prop_list.rowCount() - 1
802-
if rows >= self.limit():
803-
self._prop_list.removeRow(rows - 1)
804-
801+
# remove pre-existing instance
805802
itm_find = self._prop_list.findItems(node.id, QtCore.Qt.MatchExactly)
806803
if itm_find:
807804
self._prop_list.removeRow(itm_find[0].row())
808805

806+
rows = self._prop_list.rowCount() - 1
807+
if rows >= (self.limit()-1):
808+
# remove last row
809+
self._prop_list.removeRow(rows - 1)
810+
809811
self._prop_list.insertRow(0)
810812

811813
prop_widget = self.create_property_editor(node=node)

0 commit comments

Comments
 (0)