Order ImageDraw.rounded_rectangle() points #6956
Closed
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.
If the points given to
ImageDraw.rounded_rectangle()
aren't in the correct order, the rounded rectangle won't be drawn correctly. This change orders the coordinates before they're used.Here's what the images from my new test look like without my change:![test (10, 20, 190, 180)](https://user-images.githubusercontent.com/8922038/219400574-b668c519-2cce-44ee-921e-ae9e2477cc93.png)
![test (10, 180, 190, 20)](https://user-images.githubusercontent.com/8922038/219400578-d18e6ed8-e8fb-4b6f-a53a-f2a068ccce81.png)
![test (190, 20, 10, 180)](https://user-images.githubusercontent.com/8922038/219400579-b7f837d5-1ca2-41af-9492-5f162b658d0b.png)
![test (190, 180, 10, 20)](https://user-images.githubusercontent.com/8922038/219400580-43691977-8f64-4dd6-b9b4-b59caf2aac2b.png)
(10, 20, 190, 180)
(10, 180, 190, 20)
(190, 20, 10, 180)
(190, 180, 10, 20)