Bug 486419

Summary: Selection fills entire canvas if selection already exists when using reference layers.
Product: [Applications] krita Reporter: Ralek Kolemios <info>
Component: Tools/SelectionAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: ginoba
Priority: NOR    
Version: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Ralek Kolemios 2024-05-01 21:57:15 UTC
When selecting with the contiguous selection tool set to the 'color reference layer' method, all options are ignored and the entire canvas is selected if a selection already exists.

To recreate:
- Make a box on a color labeled layer.
- Make a selection by any method (lasso, contiguous, etc)
- Set the contiguous selection tool to 'sample color label' and set it to the color of the box layer.
- Make a selection inside the box

What happens:
- The entire canvas is selected.
(Edge case: If action type is set to 'subtract', it will leave the original selection unselected, showing that whatever function is creating the new selection is returning the full canvas and ignoring the reference layer entirely.)

What should happen:
- The selection fills the box, or if shift is held, should add the box to the initial selection.

This bug doesn't occur if there is no previous selection, or if the reference layer is single/full image. Tt works as expected.

6060b8ee
Comment 1 Deif Lou 2024-05-02 08:12:00 UTC
It also happens with the fill tool. Which makes me think is something in the scanline fill class. It already happens before my last changes, so it may be related to the "close gaps" feature, which changed the scanline fill.
Comment 2 Deif Lou 2024-05-02 08:40:48 UTC
After digging a bit, it may be that the reference image produced by KisMergeLabeledLayersCommand if not right if there is a selection.
Comment 3 Deif Lou 2024-05-02 09:52:18 UTC
Git commit 66dd431ca6d548ca7e169cc7c66568df3243f417 by Deif Lou.
Committed on 02/05/2024 at 09:51.
Pushed by deiflou into branch 'master'.

Fix issue in KisMergeLabeledLayersCommand when masks where involved

M  +8    -8    libs/image/commands_new/KisMergeLabeledLayersCommand.cpp
M  +1    -1    libs/image/commands_new/KisMergeLabeledLayersCommand.h

https://invent.kde.org/graphics/krita/-/commit/66dd431ca6d548ca7e169cc7c66568df3243f417
Comment 4 Deif Lou 2024-06-07 00:32:56 UTC
Git commit e6c53e4e2943a6ad4bc1fe365eef02a9dcd472eb by Deif Lou.
Committed on 07/06/2024 at 00:32.
Pushed by deiflou into branch 'krita/5.2'.

Fix issue in KisMergeLabeledLayersCommand when masks where involved


(cherry picked from commit 66dd431ca6d548ca7e169cc7c66568df3243f417)

Co-authored-by: Deif Lou <ginoba@gmail.com>

M  +8    -8    libs/image/commands_new/KisMergeLabeledLayersCommand.cpp
M  +1    -1    libs/image/commands_new/KisMergeLabeledLayersCommand.h

https://invent.kde.org/graphics/krita/-/commit/e6c53e4e2943a6ad4bc1fe365eef02a9dcd472eb