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

Only draw each rectangle outline pixel once #5183

merged 1 commit into from Mar 7, 2021


Copy link

@radarhere radarhere commented Jan 5, 2021

Resolves #5182

ImagingDrawRectangle draws four individual lines to make up a rectangle, including each corner twice.
This becomes apparent when the lines are drawn with partial opacity, and the repeated drawing of the corner pixels changes the final opacity.

This PR updates the function to only draw each corner pixel once, similar to #4333

Copy link

@macjohnny macjohnny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix!

Copy link

hugovk commented Mar 7, 2021

@radarhere Thanks for the fix!

@macjohnny Thanks for the report!

@hugovk hugovk merged commit 3a27118 into python-pillow:master Mar 7, 2021
@hugovk hugovk added the Bug Any unexpected behavior, until confirmed feature. label Mar 7, 2021
@radarhere radarhere deleted the rectangle branch March 7, 2021 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Bug Any unexpected behavior, until confirmed feature.
None yet

Successfully merging this pull request may close these issues.

Incorrect border color in corners when drawing rectangles with border color with opacity < 1
3 participants