Bug 322792 - mirroring a rectangular selection repeatedly causes artefacts
Summary: mirroring a rectangular selection repeatedly causes artefacts
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools/Transform (show other bugs)
Version: 2.8 Pre-Alpha
Platform: Compiled Sources All
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-24 21:31 UTC by Ren
Modified: 2013-11-12 05:01 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ren 2013-07-24 21:31:15 UTC
When I select an area in my drawing and then click on Mirror Image Horizontally and try to further move the selected area, the whole drawing moves instead even though I did nothing to deselect the area.



Reproducible: Always

Steps to Reproduce:
Draw something and select part of it to move it around;
Click on Mirror Image Horizontally;
Try to move your selection.
Actual Results:  
Trying to move the selection after having mirrored the image doesn't work, as the whole image will now move. It seems a bit counter-intuitive, as I did nothing to deselect the area, and it's quite useful to be able to check whether the change is good with a mirror image.

Expected Results:  
The small area that was selected before the mirroring should still be selected once mirrored, so that it's possible to check things around while moving them.
Comment 1 Ren 2013-07-27 18:04:27 UTC
I hadn't realised you can actually mirror your image with the M key - when I do that the selection stays selected, which is the behaviour I'd expect when using the button on the UI (which is what causes the behaviour I described).
Comment 2 Dmitry Kazakov 2013-08-08 19:49:31 UTC
Well, moving the selection after both types of mirroring works for me, but there is another bug:

When you mirror image with selection twice (or more), some weird lines can appear on the canvas:
http://wstaw.org/m/2013/08/08/plasma-desktopky2702.jpg
Comment 3 Halla Rempt 2013-08-30 11:59:14 UTC
Worse: this is not just a weird line, the selection actually breaks down, as if there is an off-by one error to the right of the mask. After mirroring several times until the error appears, then pressing cut cuts out the vertical line under the right-hand selection artefact _and_ does not cut out a corresponding line inside the real selection!
Comment 4 Dmitry Kazakov 2013-11-12 05:01:55 UTC
Git commit fcaa19849852f7eb2635bcbda4892390ff18e51d by Dmitry Kazakov.
Committed on 11/11/2013 at 11:16.
Pushed by dkazakov into branch 'master'.

Rewrite the device mirroring code

This patch does effectively three things:

1) Implements new mirroring algorithm, which
    + doesn't have rounding bugs of the previous one
    + works 4-5 times faster that the previous one
    + is the same for Horizontal and Vertical mirroring

2) Ports mirroring to the Strokes Framework (implements
   new KisMirrorProcessingVisitor)

3) Fixes exact bounds cache reset in KisPaintDevice

M  +1    -0    krita/image/CMakeLists.txt
M  +4    -0    krita/image/kis_paint_device.cc
M  +163  -97   krita/image/kis_transform_worker.cc
M  +13   -10   krita/image/kis_transform_worker.h
A  +65   -0    krita/image/processing/kis_mirror_processing_visitor.cpp     [License: GPL (v2+)]
A  +39   -0    krita/image/processing/kis_mirror_processing_visitor.h     [License: GPL (v2+)]
M  +66   -33   krita/image/tests/kis_transform_worker_test.cpp
M  +9    -2    krita/image/tests/kis_transform_worker_test.h
M  +0    -1    krita/ui/CMakeLists.txt
D  +0    -158  krita/ui/kis_mirror_visitor.cpp
D  +0    -48   krita/ui/kis_mirror_visitor.h
M  +15   -13   krita/ui/kis_node_manager.cpp

http://commits.kde.org/calligra/fcaa19849852f7eb2635bcbda4892390ff18e51d