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

Multicolor draw_rect assigns colors to vertices incorrectly #1996

Closed
v-ein opened this issue Jan 5, 2023 · 0 comments · Fixed by #2239
Closed

Multicolor draw_rect assigns colors to vertices incorrectly #1996

v-ein opened this issue Jan 5, 2023 · 0 comments · Fixed by #2239
Labels

Comments

@v-ein
Copy link
Contributor

v-ein commented Jan 5, 2023

Version of Dear PyGui

Version: 1.8.0
Operating System: Windows 10

My Issue/Question

When multicolor=True and a set of colors is specified in a draw_rect() call, the colors are assigned to wrong vertices, as if the rect was mirrored both vertically and horizontally (see the screenshot).

To Reproduce

Steps to reproduce the behavior:

  1. Run the example below.
  2. See how colors are assigned to the rect corners: color_upper_left to the bottom right corner, color_upper_right to the bottom left corner, etc.

Expected behavior

Colors should be assigned to rect corners properly according to their parameter names.

Screenshots/Video

image

Standalone, minimal, complete and verifiable example

import dearpygui.dearpygui as dpg

dpg.create_context()
dpg.create_viewport(title="Test", width=500, height=400)

dpg.setup_dearpygui()
dpg.show_viewport()

with dpg.window(pos=(100, 100), width=300, height=200, no_title_bar=True):
    with dpg.drawlist(width=280, height=180):
        dpg.draw_rectangle(
                (40, 40), (250, 150), multicolor=True,
                color_upper_left=(255, 255, 255),
                color_upper_right=(255, 0, 0),
                color_bottom_left=(0, 255, 0),
                color_bottom_right=(0, 0, 255),
                thickness=5)

dpg.start_dearpygui()
dpg.destroy_context()
@v-ein v-ein added state: pending not addressed yet type: bug bug labels Jan 5, 2023
@hoffstadt hoffstadt removed the state: pending not addressed yet label Jan 7, 2023
v-ein added a commit to v-ein/DearPyGui-fixes that referenced this issue Dec 18, 2023
hoffstadt pushed a commit that referenced this issue Dec 19, 2023
SamuMazzi pushed a commit to SamuMazzi/DearPyGui that referenced this issue Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants