-
-
Notifications
You must be signed in to change notification settings - Fork 706
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
Default horizontal window padding exists in imgui #1814
Comments
Yes, you can have the behaviour without fixing the import dearpygui.dearpygui as dpg
dpg.create_context()
SIZE = 200
texture_data = []
for i in range(0, SIZE**2):
texture_data.append(0)
texture_data.append(0)
texture_data.append(0)
texture_data.append(255 / 255)
with dpg.texture_registry():
dpg.add_static_texture(width=SIZE, height=SIZE, default_value=texture_data, tag="texture_tag")
with dpg.window():
with dpg.child_window(width=SIZE+16, height=SIZE+16, no_scrollbar=True, border=True):
dpg.add_image("texture_tag") # Remove pos constrain
dpg.show_style_editor()
dpg.create_viewport(width=SIZE*2, height=SIZE*2)
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context() |
WORKAROUND_AVAILABLE |
Looking back at this, I think the bug is actually that when you set Regarding the workaround, it isn't perfect - of course you can remove window padding from that child window and the image can be positioned at (0,0). But there isn't a way to keep window padding (which you might want for other UI elements) but force the image to be located at (0,0). FYI, the proposal that you can set def set_image_pos():
dpg.configure_item(image, pos=(0,0))
dpg.set_frame_callback(1,set_image_pos) The |
I'll keep the issue open. |
I believe I've figured this out. It's to do with Imgui and the "default window clipping rectangle":
See ocornut/imgui#3312 (comment) The 'fix' is to change the code in |
WindowPadding
not working with child windows
Version of Dear PyGui
Version: 1.6.2
Operating System: macOS
My Issue/Question
Changing WindowPadding in the y direction doesn't seem to filter down to child windows.
To Reproduce
See the MWE below
Expected behavior
I expected changing the WindowPadding to affect both x and y directions, as it does with the main window.
Screenshots/Video
Screen.Recording.2022-06-23.at.20.56.16.mov
Standalone, minimal, complete and verifiable example
The text was updated successfully, but these errors were encountered: