Bug 399146

Summary: Merging layers with alpha-inheritance ignores some of the merged layers
Product: [Applications] krita Reporter: katearcher89
Component: Layer StackAssignee: Eoin O'Neill <eoinoneill1991>
Status: RESOLVED FIXED    
Severity: normal CC: halla
Priority: NOR    
Version: 4.1.1   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: a alpha inheritance merge bug

Description katearcher89 2018-09-27 14:11:59 UTC
Created attachment 115265 [details]
a alpha inheritance merge bug

If merging in a particular order some layers are being discarded rather then merged.

How to reproduce:
1. Create three layers and group them(or download the example file)
2. Draw something on each of them.
3. Assign to the middle one an alpha inheritance.
4. Select the middle one(the one with the alpha-inheritance) first and the top one second(the order is important).
5. Merge them.
6. The bottom layer will be discarded.

Expected: Being able to merge layers without loosing them in the process.
Comment 1 Halla Rempt 2018-09-27 14:15:13 UTC
Ah, at first I thought you meant the layer with the blue scribbles at the bottom of the group, but you mean the layer with the pink scribbles, right? If so, I can confirm.
Comment 2 katearcher89 2018-09-27 14:18:45 UTC
(In reply to Boudewijn Rempt from comment #1)
> Ah, at first I thought you meant the layer with the blue scribbles at the
> bottom of the group, but you mean the layer with the pink scribbles, right?
> If so, I can confirm.

Yes, the pink one.
Comment 3 Dmitry Kazakov 2018-10-08 19:57:39 UTC
Git commit e64348e6935882fa6af2d60899860d4c1a45feb4 by Dmitry Kazakov.
Committed on 08/10/2018 at 19:57.
Pushed by dkazakov into branch 'master'.

Make merge multiple layers work consistently with weird nodes

If the node is not composed with NORMAL composite mode or
has inherit alpha enabled we should update the stack after
the node is removed.

M  +12   -1    libs/image/kis_layer_utils.cpp

https://commits.kde.org/krita/e64348e6935882fa6af2d60899860d4c1a45feb4
Comment 4 Halla Rempt 2018-10-10 09:57:26 UTC
Git commit deb13f3496e3ca0ee1c121bbba71f0e6090ce57d by Boudewijn Rempt, on behalf of Dmitry Kazakov.
Committed on 10/10/2018 at 07:42.
Pushed by rempt into branch 'krita/4.1'.

Make merge multiple layers work consistently with weird nodes

If the node is not composed with NORMAL composite mode or
has inherit alpha enabled we should update the stack after
the node is removed.
(cherry picked from commit e64348e6935882fa6af2d60899860d4c1a45feb4)

M  +12   -1    libs/image/kis_layer_utils.cpp

https://commits.kde.org/krita/deb13f3496e3ca0ee1c121bbba71f0e6090ce57d