Skip to content

Conversation

@v-ein
Copy link
Collaborator

@v-ein v-ein commented Dec 18, 2023


name: Pull Request
about: Create a pull request to help us improve
title: mvDrawRect: Replaced separate corner colors with a single parm (#1996)
assignees: @hoffstadt


Closes #1996

Description:
This PR adds a single corner_colors argument to draw_rectangle, which replaces separate color_x_y parms (e.g. color_upper_left) that are used to set colors of rectangle corners.

Old color_x_y parms were setting colors on incorrect corners ("flipped" by 180 degrees), but if we simply change their behavior to map to correct corners, it will break existing code for those who use them. That's why we have to add new parms and deprecate old ones.

I believe that in most use cases, all 4 corners need to be setup at once, so I've added a single parm to control them all. Sometimes the user might need to control just one corner, e.g. if it's a color map and one of the colors is configured with a slider or something. In such cases, it's easy to store all 4 colors in Python and pass them all together to configure_item.

Concerning Areas:
Docs at readthedocs.io will need to be updated. I haven't made any changes to the doc in this PR. Please let me know if we need doc updates in this PR too.

@hoffstadt hoffstadt merged commit 8b8d448 into hoffstadt:master Dec 19, 2023
@v-ein v-ein deleted the bugfix/1996-draw-rect-colors branch December 19, 2023 06:16
v-ein added a commit to v-ein/DearPyGui-fixes that referenced this pull request Jan 10, 2024
SamuMazzi pushed a commit to SamuMazzi/DearPyGui that referenced this pull request Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multicolor draw_rect assigns colors to vertices incorrectly

2 participants