mvDrawRect: Replaced separate corner colors with a single parm (#1996) #2239
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 todraw_rectangle
, which replaces separatecolor_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.