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

draw_rectangle with corner color attributes paints everything white for me #2352

Open ndahn opened 6 days ago

ndahn commented 6 days ago

Version of Dear PyGui

Version: 1.11.1 Operating System: Ubuntu 22.04

My Issue/Question

Calling drawrectangle with multicolor and using the color* arguments paints the rectangle all white. corner_colors works as expected. This is also seen in the demo.

To Reproduce

Open the demo and expand the "Drawing API / Basic" nodes.

Expected behavior

Individual corner color attributes should behave the same as corner_colors.

Screenshots/Video

image

Standalone, minimal, complete and verifiable example

if __name__ == "__main__":
    import dearpygui.dearpygui as dpg

    dpg.create_context()
    dpg.create_viewport(title='Demo', width=600, height=600)
    dpg.setup_dearpygui()

    with dpg.window(width=500, height=500):
        with dpg.drawlist(300, 300):
            dpg.draw_rectangle((0, 0), (300, 300), multicolor=True, color_bottom_left=[255, 0, 0],  color_bottom_right=[0, 255, 0], color_upper_left=[0, 0, 255], color_upper_right=[255, 255, 0])
            #dpg.draw_rectangle((0, 0), (300, 300), multicolor=True, corner_colors=[[255, 0, 0], [0, 255, 0], [0, 0, 255], [255, 255, 0]])

    dpg.show_viewport()
    dpg.start_dearpygui()
    dpg.destroy_context()