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
When a label is set on a window, DPG invalidates the window position
While this may be or not of importance for the main window, modals created as windows (with dpg.window and modal=True) to be shown after aren't centered since the window position is broken due to setting a label to them
A workaround is to tell DPG that the position is valid with: dpg.reset_pos(tag)
To Reproduce
Steps to reproduce the behavior:
Create a modal with dpg.window and modal=True and set to it a label
Add additional code to show the modal when clicking a button (for e.g)
The modal isn't centered
Expected behavior
The modal should be centered
Screenshots/Video
Without the workaround:
With the workaround:
Standalone, minimal, complete and verifiable example
At some point, this "dirtyPos = true" line had got a comment saying "this is necessary because imgui considers it a new window" - see it after commit ee26195. For some reason, the comment got lost in future commits.
Version of Dear PyGui
Version: 1.9.1
Operating System: Windows 10
My Issue/Question
When a label is set on a window, DPG invalidates the window position
While this may be or not of importance for the main window, modals created as windows (with
dpg.window
andmodal=True
) to be shown after aren't centered since the window position is broken due to setting a label to themA workaround is to tell DPG that the position is valid with:
dpg.reset_pos(tag)
To Reproduce
Steps to reproduce the behavior:
dpg.window
andmodal=True
and set to it a labelExpected behavior
The modal should be centered
Screenshots/Video
Without the workaround:
With the workaround:
Standalone, minimal, complete and verifiable example
Also Tetane's workaround is applied from issue #1978
cc: @v-ein (thanks for the help on Discord!)
The text was updated successfully, but these errors were encountered: