You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In DearPyGui 2.0, nodes exhibit unintended width expansion under the following conditions:
The node has an empty first attribute (either input/output/static) or the node contains an empty nested attribute (with no nested child, e.g., no text). This issue causes the node to expand slightly on each render.
This behavior is observed on DPG 2.0 but is not present in DPG 1.8.0, where nodes work as expected.
Bug occurs:
Node with an empty input and an empty output attribute.
Node with an empty input and a filled output attribute.
Works correctly:
Node with a filled input and a filled output attribute.
Node with a filled input and an empty output attribute.
The bug seems to come from the automatic sizing mechanism, which fails to determine the node's width correctly if the first child attribute is empty.
Adding a time.sleep(0.25) to slow the framerate confirms that the node extend progressively on each render instead of being created with an infinite width.
Adding an empty string to the first attribute can mitigate the issue, but this increases the node's height slightly.
To Reproduce
Steps to reproduce the behavior:
Create a node_editor
Add an empty node with either
A. dpg.add_node()
B. with dpg.node(): pass
Or add a node with the FIRST attribute empty :
A. with dpg.node(): dpg.add_node_attribute(attribute_type=dpg.mvNode_Attr_Output)
B. with dpg.node(): with dpg.node_attribute(attribute_type=dpg.mvNode_Attr_Output) : pass
Expected behavior
The node should have a fixed width that scale to the size of the node label (if the node does not have children) or the largest attribute (if the node have one or more children).
Screenshot
Standalone, minimal, complete and verifiable example
importdearpygui.dearpyguiasdpgdpg.create_context()
dpg.create_viewport(title="Expanding node bug", width=1280, height=720)
withdpg.window(label="Node Editor", width=1280, height=720):
withdpg.node_editor(tag="node_editor", minimap=True, minimap_location=dpg.mvNodeMiniMap_Location_BottomRight):
dpg.add_node(label="Bugged node 1", pos=[100, 0])
withdpg.node(label="Bugged node 2", pos=[100, 50]):
passwithdpg.node(label="Bugged node 3", pos=[100, 100]):
dpg.add_node_attribute(label="Input", attribute_type=dpg.mvNode_Attr_Output)
withdpg.node(label="Bugged node 4", pos=[100, 150]):
withdpg.node_attribute(label="Test", attribute_type=dpg.mvNode_Attr_Output) :
passwithdpg.node(label="Working node 1", pos=[100, 250]):
withdpg.node_attribute(label="Test", attribute_type=dpg.mvNode_Attr_Output) :
dpg.add_text("This is a working node if the attribute have a child")
withdpg.node(label="Bugged node fixed with empty string", pos=[100, 325]):
withdpg.node_attribute(label="Test", attribute_type=dpg.mvNode_Attr_Output) :
dpg.add_text("")
withdpg.node(label="Bugged node 5", pos=[100, 450]):
dpg.add_node_attribute(label="Input", attribute_type=dpg.mvNode_Attr_Input)
withdpg.node_attribute(label="Test", attribute_type=dpg.mvNode_Attr_Output) :
dpg.add_text("If the first attribute is empty the node will be bugged")
withdpg.node(label="Bugged node 5 fixed", pos=[100, 525]):
withdpg.node_attribute(label="Test", attribute_type=dpg.mvNode_Attr_Output) :
dpg.add_text("If the first attribute have a child the node will be working correctly")
dpg.add_node_attribute(label="Input", attribute_type=dpg.mvNode_Attr_Input)
dpg.setup_dearpygui()
dpg.show_viewport()
importtimewhiledpg.is_dearpygui_running():
dpg.render_dearpygui_frame()
time.sleep(0.25)
dpg.destroy_context()
The text was updated successfully, but these errors were encountered:
Version of Dear PyGui
Version: 2.0.0
Operating System: Windows 11
My Issue/Question
In DearPyGui 2.0, nodes exhibit unintended width expansion under the following conditions:
The node has an empty first attribute (either input/output/static) or the node contains an empty nested attribute (with no nested child, e.g., no text). This issue causes the node to expand slightly on each render.
This behavior is observed on DPG 2.0 but is not present in DPG 1.8.0, where nodes work as expected.
Bug occurs:
Works correctly:
The bug seems to come from the automatic sizing mechanism, which fails to determine the node's width correctly if the first child attribute is empty.
Adding a
time.sleep(0.25)
to slow the framerate confirms that the node extend progressively on each render instead of being created with an infinite width.Adding an empty string to the first attribute can mitigate the issue, but this increases the node's height slightly.
To Reproduce
Steps to reproduce the behavior:
A.
dpg.add_node()
B.
with dpg.node(): pass
A.
with dpg.node(): dpg.add_node_attribute(attribute_type=dpg.mvNode_Attr_Output)
B.
with dpg.node(): with dpg.node_attribute(attribute_type=dpg.mvNode_Attr_Output) : pass
Expected behavior
The node should have a fixed width that scale to the size of the node label (if the node does not have children) or the largest attribute (if the node have one or more children).
Screenshot
Standalone, minimal, complete and verifiable example
The text was updated successfully, but these errors were encountered: