Bug 303379 - Mirror on layer with oddly shaped selection corrups layer data
Summary: Mirror on layer with oddly shaped selection corrups layer data
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools/Transform (show other bugs)
Version: git master (please specify the git hash!)
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-11 17:01 UTC by Sven Langkamp
Modified: 2013-09-26 19:30 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot (294.33 KB, image/png)
2012-07-11 17:01 UTC, Sven Langkamp
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Langkamp 2012-07-11 17:01:08 UTC
Mirror on layer with oddly shaped selection corrups layer data. See attached screenshot.

Reproducible: Always

Steps to Reproduce:
1. make selection like in the screenshot
2. mirror horizontally
Actual Results:  
Layer data is garbled
Comment 1 Sven Langkamp 2012-07-11 17:01:39 UTC
Created attachment 72457 [details]
Screenshot
Comment 2 Sven Langkamp 2012-07-11 18:41:01 UTC
Should mirroring even take the selection into account? If the selection is used to select the source and limit the destination, I think it's almost unpredictable by the user how the result would look like. I also looked at Gimp and it does always mirror the whole layer, even if there is a selection.
Comment 3 Halla Rempt 2012-07-11 19:11:35 UTC
Hm.... I think at one point we wanted to have the selection determine which part was going to be mirrored, but not limit the pixels we'd write to; and the selection would also determine the midpoint of the mirrored part.
Comment 4 Sven Langkamp 2012-07-11 19:43:50 UTC
It's a bit confusing, I think, as the other actions in that group like shear, scale and rotate all work directly on the layer without using the selection. 

Beside that it might also make more sense if the layer has a local selection. If we mirror the layer and the mask there is a situation where the layer would be mirrored using the selection and the selection itself woud be mirrored as part of the local selection.
Comment 5 Sven Langkamp 2012-07-12 09:48:00 UTC
Git commit 6e06c169b14b903f32280669369d83408474afaf by Sven Langkamp.
Committed on 12/07/2012 at 11:30.
Pushed by langkamp into branch 'master'.

moved mirroring code to a node visitor. This fixes mirroring of group layers and local selections.
Also removes duplicated code from layer and mask manager and puts it into the node manager.

Using selections is disabled for now as that produces some problems. Mirroring shape selections still not working.
Related: bug 298719

M  +1    -0    krita/ui/CMakeLists.txt
M  +1    -76   krita/ui/kis_layer_manager.cc
M  +0    -2    krita/ui/kis_layer_manager.h
M  +0    -44   krita/ui/kis_mask_manager.cc
M  +0    -10   krita/ui/kis_mask_manager.h
A  +156  -0    krita/ui/kis_mirror_visitor.cpp     [License: GPL (v2+)]
A  +48   -0    krita/ui/kis_mirror_visitor.h     [License: GPL (v2+)]
M  +29   -4    krita/ui/kis_node_manager.cpp
M  +2    -0    krita/ui/kis_node_manager.h

http://commits.kde.org/calligra/6e06c169b14b903f32280669369d83408474afaf
Comment 6 Sven Langkamp 2012-07-12 09:52:47 UTC
I have disabled the use of the selection until this bug is resolved. Downgrading to normal.
Comment 7 T Zachmann 2012-07-25 16:38:28 UTC
Git commit a5bc1bd8100f24624f767fd4eb8d19a100bf5c83 by Thorsten Zachmann, on behalf of Sven Langkamp.
Committed on 12/07/2012 at 11:30.
Pushed by zachmann into branch 'calligra/2.5'.

moved mirroring code to a node visitor. This fixes mirroring of group layers and local selections.

Also removes duplicated code from layer and mask manager and puts it into the node manager.

Using selections is disabled for now as that produces some problems. Mirroring shape selections still not working.
Related: bug 298719
(cherry picked from commit 6e06c169b14b903f32280669369d83408474afaf)

M  +1    -0    krita/ui/CMakeLists.txt
M  +1    -76   krita/ui/kis_layer_manager.cc
M  +0    -2    krita/ui/kis_layer_manager.h
M  +0    -44   krita/ui/kis_mask_manager.cc
M  +0    -10   krita/ui/kis_mask_manager.h
A  +156  -0    krita/ui/kis_mirror_visitor.cpp     [License: GPL (v2+)]
A  +48   -0    krita/ui/kis_mirror_visitor.h     [License: GPL (v2+)]
M  +29   -4    krita/ui/kis_node_manager.cpp
M  +2    -0    krita/ui/kis_node_manager.h

http://commits.kde.org/calligra/a5bc1bd8100f24624f767fd4eb8d19a100bf5c83
Comment 8 Halla Rempt 2013-09-26 19:30:48 UTC
I think the current behaviour is actually fine :-). Let's close the bug.