-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Fix don't paint transparent color via Eraser tool in Background layers (fix #4370) #4420
base: main
Are you sure you want to change the base?
Conversation
fix aseprite#4370) Before this fix, when working with sprites that included a background layer and using the Eraser tool, drawing transparent pixels was allowed if the secondary color was transparent + right click (i.e. eraser in replace mode "Primary color ->to-> Secondary"). Original issue aseprite#4370 description: "Downloaded PNG in RGB mode fails to support transparency: erase uses secondary color and export PNG replaces transparent color with black"
clang-tidy review says "All clean, LGTM! 👍" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix works as intended. I'm just not sure if it works as expected. Because the paint bucket behaves different when trying to paint a background layer with a color that has an alpha < 255. For instance, with this fix, a full transparent black will be painted as black by the eraser but as nothing (no color is painted) by the paint bucket.
@martincapello and I verified the correct behavior of Paint Bucket Tool (there was only one confusion about the ink used during testing). |
loop->setSecondaryColor(loop->getBgColor() | | ||
(loop->getLayer()->isBackground() ? ColorAMask : 0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works only for RGB images, but here getBgColor()
and setSecondaryColor()
could be handling an index or a grayscale color (the bug is reproducible in a grayscale image even with this patch).
Original issue #4370 description:
"Downloaded PNG in RGB mode fails to support transparency: erase uses secondary color and export PNG replaces transparent color with black"
fix #4370