Skip to content

If left and right sides meet in ImageDraw.rounded_rectangle(), do not draw rectangle to fill gap#8304

Merged
hugovk merged 1 commit intopython-pillow:mainfrom
radarhere:rounded_rectangle
Aug 15, 2024
Merged

If left and right sides meet in ImageDraw.rounded_rectangle(), do not draw rectangle to fill gap#8304
hugovk merged 1 commit intopython-pillow:mainfrom
radarhere:rounded_rectangle

Conversation

@radarhere
Copy link
Copy Markdown
Member

@radarhere radarhere commented Aug 15, 2024

Resolves #8303

rounded_rectangle() draws

  1. the corners
  2. a vertical rectangle to join the left and right sides
  3. a rectangle on the left to join the top left and lower left corners
  4. a rectangle on the right to join the top right and lower right corners

The code from the issue is failing in step 2 when there is no gap between the left and the right sides. So this PR skips that step if it isn't needed.

@hugovk hugovk merged commit 394e850 into python-pillow:main Aug 15, 2024
@radarhere radarhere deleted the rounded_rectangle branch August 15, 2024 20:33
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.

ImageDraw.rounded_rectangle: wrong ValueError

2 participants