Bug 405686 - Merge layers can cause the merged layer to be in a different position in the layer stack
Summary: Merge layers can cause the merged layer to be in a different position in the ...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Layer Stack (show other bugs)
Version: git master (please specify the git hash!)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Tiar
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-20 13:24 UTC by Tiar
Modified: 2019-04-09 09:12 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Test .kra file (536.00 KB, application/zip)
2019-03-20 13:24 UTC, Tiar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tiar 2019-03-20 13:24:48 UTC
Created attachment 118936 [details]
Test .kra file

SUMMARY
When you merge layers from the example file in the order provided in the "steps" section, the merged layer will be appear at the top of the layer stack instead of being one layer below. Thus the projection is different before and after merge.


STEPS TO REPRODUCE
1. Open the provided file.
2. Select layers: Layer 5, Layer 3, Layer 2, Layer 4. (For example: select layer 5; hold Shift; select layer 4.) The active layer must be layer 4.
3. Use shortcut (default: ctrl+E), Layer -> Merge with layer below, or right-click on the layer 4 (important!) and select "Merge with layer below".

OBSERVED RESULT
The result layer appears on top of the layer stack instead of the correct position.

EXPECTED RESULT
The result layer should be one layer below the top of the layer stack.

NOTES: 
- If layer 5 is selected or you right-click on layer 5, the result layer will be in a correct position.
- If you undo, the selected layer will be only Layer 5 and Layer 3.

The test file is a modified version of a file from bug 405366.


Krita

 Version: 4.2.0-pre-alpha (git fbba406)
 Languages: pl
 Hidpi: false

Qt

  Version (compiled): 5.11.3
  Version (loaded): 5.11.3

OS Information

  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 4.15.0-45-generic
  Pretty Productname: Linux Mint 19.1
  Product Type: linuxmint
  Product Version: 19.1


Hardware Information

  GPU Acceleration: auto
  Memory: 7771 Mb
  Number of Cores: 4
  Swap Location: /tmp

ADDITIONAL INFORMATION
Git hash: fbba406b15d7f6b066fd40
Comment 1 Halla Rempt 2019-04-04 09:49:40 UTC
Yes, I can confirm this still happens.
Comment 2 Tiar 2019-04-09 09:12:15 UTC
Git commit 214d419c911ba18d7989865ae5bf6fd2b0fdd045 by Agata Cacko.
Committed on 09/04/2019 at 09:09.
Pushed by tymond into branch 'master'.

Fix wrong position of the merged layer

Before this patch, if you had a standard layer, then group
layer, then two more layers inside the group and tried to
merge them, selecting all and keeping the last mentioned layer
(inside the group) selected, the merged layer appeared on top
of the layers stack instead of the place of source layers.
After this commit, the merged layer is put in the place of
the active layer.

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

https://commits.kde.org/krita/214d419c911ba18d7989865ae5bf6fd2b0fdd045