Skip to content

Commit 505664c

Browse files
authored
Merge pull request #459 from jonassorgenfrei/fix-property-limit
fixes the limit box for the prop_list
2 parents 0f82685 + afb55c2 commit 505664c

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,15 +798,17 @@ 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

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

811813
prop_widget = self.create_property_editor(node=node)
812814
prop_widget.property_closed.connect(self.__on_prop_close)

0 commit comments

Comments
 (0)