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
Image quads rendered by draw_image_quad get distorted, with two vertices offset from what positions are specified for them. For example, if one attempts to render a square, DPG shows a parallelogram instead (see the screenshot).
To Reproduce
Steps to reproduce the behavior:
Create a draw list, positioned somewhere in the middle of the window (the farther from its top left corner, the better).
Add an image quad to it, specifying such vertices that you can for sure tell what shape it should have.
See how some vertices end up in completely different places on the screen.
Alternatively, use the example below:
Create a test image named "test.png" and put it alongside the example script.
Run the script.
In a correctly working version, the image must be square and its boundaries must match those of the green translucent square in front of it. If any boundaries do not match, it's a bug (see the screenshot).
Expected behavior
No unexpected shape distortion in draw_image_quad.
Screenshots/Video
Standalone, minimal, complete and verifiable example
importdearpygui.dearpyguiasdpgdpg.create_context()
dpg.create_viewport(width=600, height=600)
dpg.setup_dearpygui()
width, height, channels, data=dpg.load_image('test.png')
withdpg.texture_registry():
dpg.add_static_texture(width, height, data, tag="image")
withdpg.window(label="Test", width=550, height=550):
# Somehow drawlist ignores pos=(x, y), so we're using a group to place the# draw list into the desired position. The larger the offset from (0, 0),# the more distorted image_quad will be.withdpg.group(pos=(200, 200)):
withdpg.drawlist(width=300, height=300):
withdpg.draw_layer(tag="main pass", depth_clipping=True, perspective_divide=True, cull_mode=dpg.mvCullMode_None):
dpg.set_clip_space(dpg.last_item(), 0, 0, 300, 300, -1.0, 1.0)
withdpg.draw_node(tag="cube"):
proj=dpg.create_orthographic_matrix(-20, 20, -20, 20, -50, 50)
dpg.apply_transform(dpg.last_item(), proj)
s=5dpg.draw_image_quad("image", (-s, -s), (s, -s), (s, s), (-s, s))
z=0.1# Triangles seem to be transformed properly, so we're using# two triangles to simulate a square.dpg.draw_triangle((-s, -s, -z), (s, s, -z), (s, -s, -z), color=(0, 0, 0, 0), fill=(0, 255, 0, 128))
dpg.draw_triangle((-s, -s, -z), (-s, s, -z), (s, s, -z), color=(0, 0, 0, 0), fill=(0, 255, 0, 128))
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
The text was updated successfully, but these errors were encountered:
Version of Dear PyGui
Version: 1.9.1
Operating System: Windows 10
My Issue/Question
Image quads rendered by draw_image_quad get distorted, with two vertices offset from what positions are specified for them. For example, if one attempts to render a square, DPG shows a parallelogram instead (see the screenshot).
To Reproduce
Steps to reproduce the behavior:
Alternatively, use the example below:
Expected behavior
No unexpected shape distortion in draw_image_quad.
Screenshots/Video
Standalone, minimal, complete and verifiable example
The text was updated successfully, but these errors were encountered: