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

Fixed ClearRect unable to clear transparent image #165

Merged
merged 1 commit into from
Mar 13, 2021
Merged

Fixed ClearRect unable to clear transparent image #165

merged 1 commit into from
Mar 13, 2021

Conversation

ph1048
Copy link

@ph1048 ph1048 commented Mar 13, 2021

Hello!

I am using draw2dimg to draw things on a transparent html5 canvas, and current implementation of ClearRect uses draw.Over operation, which is unable to clear image to a fully transparent state. I suggest using draw.Src, as it allows users to clear area with transparent pixels. IMO, for transparent images this behaviour is somewhat intuitive.
Also, this behaviour would not break existing behaviour for fully opaque clear operations.

@llgcode
Copy link
Owner

llgcode commented Mar 13, 2021

You are right @ph1048, it's correct. It seems to not break anything. Thanks for your contribution. I'll merge your change.

@llgcode llgcode merged commit 577c1ea into llgcode:master Mar 13, 2021
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.

None yet

2 participants