Bug 390095

Summary: Merging group layer with "inherit alpha" active results in empty layer
Product: [Applications] krita Reporter: kalia24
Component: Layer StackAssignee: Dmitry Kazakov <dimula73>
Status: RESOLVED FIXED    
Severity: normal CC: griffinvalley, halla, nickelbacher
Priority: NOR Keywords: triaged
Version: 4.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: file to reproduce with.

Description kalia24 2018-02-08 19:06:01 UTC
Steps:
1. Create document with partially-transparent base layer (#1).
2. Create group layer with at least one partially-transparent layer that overlaps #1 in it (#2).
3. Create another group layer, add #1 and #2 to it (with #2 on top), activate "Inherit alpha" in #2 (content of #2 gets cropped by content of #1 = correct).
4. Perform "Merge group" on #2 -> merged layer is empty (incorrect :P ).
Comment 1 Halla Rempt 2018-02-08 19:10:27 UTC
Hi Kalia!

Could you please check whether this is a regression from 3.3.3?

Thanks!
Comment 2 wolthera 2018-02-08 19:12:45 UTC
Created attachment 110446 [details]
file to reproduce with.

I can confirm, attachinga small file to reproduce with. Layer 2 needs to have "merge group" applied.
Comment 3 kalia24 2018-02-09 11:48:33 UTC
Hi Boudewijn!

The issue is present in 3.3.3 as well - when you flatten group layer with inherited alpha, it leaves empty layer.
Comment 4 Halla Rempt 2018-02-09 12:08:20 UTC
Thanks for checking!
Comment 5 Dmitry Kazakov 2018-04-03 15:00:31 UTC
Git commit 39cc9f9e115da66563712bf8ba5b941e9be0a85a by Dmitry Kazakov.
Committed on 03/04/2018 at 15:00.
Pushed by dkazakov into branch 'master'.

Fix flattening of group layers with Inherit Alpha property set

If all the selected layers have the same composite op and channel
flags we should just merge them together using Normal composition
and write into a destination layer with their original composition
and channel flags.

M  +56   -2    libs/image/kis_layer_utils.cpp

https://commits.kde.org/krita/39cc9f9e115da66563712bf8ba5b941e9be0a85a
Comment 6 Dmitry Kazakov 2018-04-07 13:44:50 UTC
Git commit 0e101cd875a5d86bc77406656c218fd94bc9a494 by Dmitry Kazakov.
Committed on 07/04/2018 at 13:28.
Pushed by dkazakov into branch 'krita/4.0'.

Fix flattening of group layers with Inherit Alpha property set

If all the selected layers have the same composite op and channel
flags we should just merge them together using Normal composition
and write into a destination layer with their original composition
and channel flags.

M  +56   -2    libs/image/kis_layer_utils.cpp

https://commits.kde.org/krita/0e101cd875a5d86bc77406656c218fd94bc9a494