hoffstadt / DearPyGui

Dear PyGui: A fast and powerful Graphical User Interface Toolkit for Python with minimal dependencies
https://dearpygui.readthedocs.io/en/latest/
MIT License
12.62k stars 669 forks source link

[nodes] Tree node continues through the parent #1971

Open luisarandas opened 1 year ago

luisarandas commented 1 year ago

Version of Dear PyGui

Version: 1.8.0 Operating System: Ubuntu 22.04

My Issue/Question

When adding a tree node to a node it doesn't maintain the group or node size.

To Reproduce

Just run the example and hover on it

Expected behavior

Ability to control its size

Screenshots/Video

bug1

Standalone, minimal, complete and verifiable example


import dearpygui.dearpygui as dpg

dpg.create_context()

# callback runs when user attempts to connect attributes
def link_callback(sender, app_data):
    # app_data -> (link_id1, link_id2)
    dpg.add_node_link(app_data[0], app_data[1], parent=sender)

# callback runs when user attempts to disconnect attributes
def delink_callback(sender, app_data):
    # app_data -> link_id
    dpg.delete_item(app_data)

with dpg.window(label="Tutorial", width=400, height=400):

    with dpg.node_editor(callback=link_callback, delink_callback=delink_callback):
        with dpg.node(label="Node 1"):
            with dpg.node_attribute(label="Node A1"):
                dpg.add_tree_node(label="ok")

dpg.create_viewport(title='Custom Title', width=800, height=600)
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
luisarandas commented 1 year ago

I should add, that in dpg.add_separator() this also happens! Exact same thing in the small line

georgedimitriadis commented 2 months ago

I have exactly the same problem with the add_separator. I add one as an attribute to a Node and it continues outside the Node.

DPG 1.11.1 Windows 11 Pyhton 3.11

Separator bug