Bug 345612 - Transparency masks not retained when you flatten out a duplicated masked layer?
Summary: Transparency masks not retained when you flatten out a duplicated masked layer?
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Layer Stack (show other bugs)
Version: 2.9.1
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-28 11:51 UTC by mvowada
Modified: 2016-04-22 09:50 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Transparency masks not retained when you flatten out a layer? - (Video) (549.21 KB, video/mp4)
2015-03-28 11:52 UTC, mvowada
Details
Video. (827.02 KB, video/mp4)
2015-06-20 22:38 UTC, mvowada
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mvowada 2015-03-28 11:51:16 UTC
Please, see the short video in attachment in the comment below. 

When you flatten a layer any Transparency masks should be applied before the layer is being flattened, in my opinion. It should happen with any type of layer, also.

Krita: 2.9.1 (git 3367bdf)

Reproducible: Always

Steps to Reproduce:
1. Drag-and-Select a limited portion of a painted layer
2. apply a transparency mask to the layer
3. flatten out the layer

Actual Results:  
The resulting flattened layer, has not retained the transparent areas which were set by the trasparency mask.

Expected Results:  
Any transparency masks should be applied before the layer is being flattened, in my opinion.
Comment 1 mvowada 2015-03-28 11:52:56 UTC
Created attachment 91790 [details]
Transparency masks not retained when you flatten out a layer? - (Video)
Comment 2 Scott Petrovic 2015-06-19 22:23:32 UTC
Is this still an issue. I just tested this scenario on 2.9.5.1 and it seems to be working fine. I tried two tests.

1. Create a paint layer and painted a few dabs
2. created a transparency mask that cuts off some of the dabs
3. flatten the paint layer

The transparency mask is applied correctly before it is flattened.

My second test did the same thing, except I put the paint layer and transparency mask in a group layer. I flattened out the group layer, and the paint layer seemed to apply the transparency mask ok.
Comment 3 mvowada 2015-06-20 22:36:42 UTC
(In reply to mvowada from comment #0)
> Steps to Reproduce:
> 1. Drag-and-Select a limited portion of a painted layer
> 2. apply a transparency mask to the layer
> 3. flatten out the layer

The issue is still present on duplicated masked layers.

Steps to Reproduce:
1. Drag-and-Select a limited portion of a painted layer
2. apply a transparency mask to the layer
3. duplicate the masked layer
3. flatten out the layer
Comment 4 mvowada 2015-06-20 22:38:50 UTC
Created attachment 93270 [details]
Video.
Comment 5 Halla Rempt 2015-08-14 13:33:20 UTC
Let's reopen then.
Comment 6 Dmitry Kazakov 2016-04-22 09:50:04 UTC
Git commit 8a9660abf3e52e7a8553d0fb44a50c3639253c9d by Dmitry Kazakov.
Committed on 22/04/2016 at 09:48.
Pushed by dkazakov into branch 'master'.

Fix masks update problem

1) Create a paint layer (layer1) filled with color
2) Create a paint layer (layer2) with anything
3) Add a transparency mask to layer1 (tmask1)
4) Make tmask1 invisible

Layer1's projection is now filled with non-cropped color

5) Make layer1 invisible
6) Make layer2 invisible

7) Make tmask1 visible
Layer1's projection is still filled with non-cropped
color, because it is invisible and its updates are locked.

8) Make layer1 visible
The *cropped* area is rendered on screen, layer1'a
projection is still wrong!

9) Make layer2 visible
Wrong layer1's projection is now painted on screen -> BUG

This patch fixes the problem by re-rendering the
layer1's projection at step 8.
Related: bug 349484
Ref T2085

M  +15   -0    libs/image/kis_layer.cc

http://commits.kde.org/krita/8a9660abf3e52e7a8553d0fb44a50c3639253c9d