Bug fix: Handling of alpha pixels when committing selection #840
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.
When you finish a selection with pixels that aren't fully-opaque (whether due to layer opacity or the pixels' alpha channel), those pixels are blended with the target layer according to the opacity, but this is not the proper semantic for a selection. If you create a selection and then use Move Selection tool to relocate it, within that layer, the pixels' opacity should simply be translated along with the colour. This PR fixes selection moves so that when the selection is "dropped" onto the underlying layer, it simply replaces all of the pixels involved. It implements this by still blending the pixels the way it did before, but by clearing the underlying pixels so that there's nothing there for them to blend with. The new blend method ignores the layer opacity as well.
There is a separate bug in how the selection layer is previewed. Prior to finishing the selection, it will appear incorrectly blended with the underlying pixels. That is outside of the scope of this PR.
Before moving selection:
After moving selection, before finish selection:
After finishing selection:
This PR partially fixes #819.