Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Crash] DPG 1.6 crash when use 2 NodeStyleVar #1732

Closed
nvglucifer opened this issue Apr 26, 2022 · 2 comments
Closed

[Crash] DPG 1.6 crash when use 2 NodeStyleVar #1732

nvglucifer opened this issue Apr 26, 2022 · 2 comments
Labels
state: ready Fixed/Added and will be present in an upcoming release type: bug bug

Comments

@nvglucifer
Copy link

Version of Dear PyGui

Version: 1.6
Python : 3.9.7
Operating System: Windows 10

My Issue/Question

DPG 1.6 crash when use 2 NodeStyleVar: mvNodeStyleVar_NodePaddingHorizontal and mvNodeStyleVar_NodePaddingVertical.
These 2 padding is working in DPG 1.5.1.

To Reproduce

python code below

Expected behavior


Screenshots/Video


Standalone, minimal, complete and verifiable example

import dearpygui.dearpygui as dpg

dpg.create_context()

with dpg.window(width=500, height=500):
    with dpg.node_editor():
        pass

with dpg.theme() as theme:
    with dpg.theme_component(dpg.mvAll):
        dpg.add_theme_style(dpg.mvNodeStyleVar_GridSpacing, 64, category=dpg.mvThemeCat_Nodes)
        
        # dpg 1.5.1, no crash but dpg 1.6
        dpg.add_theme_style(dpg.mvNodeStyleVar_NodePaddingHorizontal, 4, category=dpg.mvThemeCat_Nodes)
        dpg.add_theme_style(dpg.mvNodeStyleVar_NodePaddingVertical, 4, category=dpg.mvThemeCat_Nodes)

dpg.bind_theme(theme)

dpg.create_viewport(title="Test_", width=1280, height=720)
dpg.setup_dearpygui()

dpg.show_viewport()
while dpg.is_dearpygui_running():
    dpg.render_dearpygui_frame()
dpg.destroy_context()
@nvglucifer nvglucifer added state: pending not addressed yet type: bug bug labels Apr 26, 2022
@hoffstadt hoffstadt added priority: high high priority and removed state: pending not addressed yet labels Apr 26, 2022
@hoffstadt
Copy link
Owner

Fixed in 1.6.1 with a breaking change, mvNodeStyleVar_NodePaddingHorizontal and mvNodeStyleVar_NodePaddingVertical was combined int mvNodeStyleVar_NodePadding by imnodes. In 1.6.1, you must now do:

import dearpygui.dearpygui as dpg

dpg.create_context()

with dpg.window(width=500, height=500):
    with dpg.node_editor():
        pass

with dpg.theme() as theme:
    with dpg.theme_component(dpg.mvAll):
        dpg.add_theme_style(dpg.mvNodeStyleVar_GridSpacing, 64, category=dpg.mvThemeCat_Nodes)
        
        # dpg 1.5.1, no crash but dpg 1.6
        dpg.add_theme_style(dpg.mvNodeStyleVar_NodePadding, 4, 4, category=dpg.mvThemeCat_Nodes)

dpg.bind_theme(theme)

dpg.create_viewport(title="Test_", width=1280, height=720)
dpg.setup_dearpygui()

dpg.show_viewport()
while dpg.is_dearpygui_running():
    dpg.render_dearpygui_frame()
dpg.destroy_context()

@hoffstadt hoffstadt added state: ready Fixed/Added and will be present in an upcoming release and removed priority: high high priority labels Apr 27, 2022
@hoffstadt
Copy link
Owner

About to deploy now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: ready Fixed/Added and will be present in an upcoming release type: bug bug
Projects
None yet
Development

No branches or pull requests

2 participants