Bug 298584 - When moving a layer that is fully selected it should not create an empty layer
Summary: When moving a layer that is fully selected it should not create an empty layer
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Usability (show other bugs)
Version: git master (please specify the git hash!)
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-22 08:34 UTC by Cyrille Berger
Modified: 2012-12-02 07:15 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cyrille Berger 2012-04-22 08:34:17 UTC
To reproduce:
* create a new layer
* draw something
* select all in the layer
* use the move tool to move it
=> krita creates an empty layer

It might sounds weird to do such a thing but it also happen with this common use case:
* select an area of drawing
* copy / paste (the selection is still there)
* move the copied layer
=> krita creates an empty layer
Comment 1 Halla Rempt 2012-04-22 09:48:36 UTC
Hm, yes... Unfortunately, it's difficult to fix properly since the other common usecase, select part of an image and move it, requires creating a new layer.
Comment 2 Sven Langkamp 2012-07-17 19:41:52 UTC
Might be better to go the Gimp way. Move tool would just move layer, but not care about the selection. If you want to move the selection, use the transform tool.
Comment 3 Halla Rempt 2012-07-17 20:38:00 UTC
Yeah.... It would be a pity of the enormous amount of time I've invested in making the move tool move the selection transparently -- in answer to user's requests, but in the end... But let;s check in any case what photoshop does before disabling this. Otherwise, we'll get valid requests to put it back.
Comment 4 Sven Langkamp 2012-07-17 20:55:19 UTC
The problem with fixing the bug is that it would be pretty difficult to fix it in a sane way. We would need to check if every pixel is in the selection and when that's the case move the whole layer. For the user it might be confusing if the tool switches between the modes.

We could make it optional. There could be a checkbox "use selection" in the tool options, similar to the fill tool.
Comment 5 Dmitry Kazakov 2012-11-07 13:34:41 UTC
Git commit 40bdd4ab49f58ca46ff8c275878556572116c566 by Dmitry Kazakov.
Committed on 07/11/2012 at 14:34.
Pushed by dkazakov into branch 'krita-new-move-tool-kazakov'.

Made the move tool iterational

Now the tool does not create new layers and does not create
numerous undo commands. It works in an iterational way: you move
the node (or selection) as many times as you wish. After the moving
done and you switch the tool (or apply any other action) the move
stroke will be finished and added to your undo history.

Please test it in 'krita-new-move-tool-kazakov' branch.
CCMAIL:kimageshop@kde.org

M  +30   -0    krita/image/kis_image.cc
M  +43   -0    krita/image/kis_image.h
M  +8    -0    krita/image/kis_stroke_strategy_undo_command_based.cpp
M  +6    -1    krita/image/kis_stroke_strategy_undo_command_based.h
M  +1    -0    krita/plugins/tools/defaulttools/CMakeLists.txt
M  +63   -110  krita/plugins/tools/defaulttools/kis_tool_move.cc
M  +5    -1    krita/plugins/tools/defaulttools/kis_tool_move.h
A  +132  -0    krita/plugins/tools/defaulttools/strokes/move_selection_stroke_strategy.cpp     [License: GPL (v2+)]
A  +49   -0    krita/plugins/tools/defaulttools/strokes/move_selection_stroke_strategy.h     [License: GPL (v2+)]
M  +2    -0    krita/ui/kis_doc2_p.h
M  +8    -0    krita/ui/kis_filter_handler.cc
M  +12   -0    krita/ui/tool/kis_tool.cc
M  +14   -0    krita/ui/tool/kis_tool.h

http://commits.kde.org/calligra/40bdd4ab49f58ca46ff8c275878556572116c566
Comment 6 Dmitry Kazakov 2012-12-02 07:15:22 UTC
Git commit 546a8c7ead456cd86a63b8853c424e230dfdad66 by Dmitry Kazakov.
Committed on 07/11/2012 at 14:34.
Pushed by dkazakov into branch 'calligra/2.6'.

Made the move tool iterational

Now the tool does not create new layers and does not create
numerous undo commands. It works in an iterational way: you move
the node (or selection) as many times as you wish. After the moving
done and you switch the tool (or apply any other action) the move
stroke will be finished and added to your undo history.

Please test it in 'krita-new-move-tool-kazakov' branch.
CCMAIL:kimageshop@kde.org

M  +30   -0    krita/image/kis_image.cc
M  +43   -0    krita/image/kis_image.h
M  +8    -0    krita/image/kis_stroke_strategy_undo_command_based.cpp
M  +6    -1    krita/image/kis_stroke_strategy_undo_command_based.h
M  +1    -0    krita/plugins/tools/defaulttools/CMakeLists.txt
M  +63   -110  krita/plugins/tools/defaulttools/kis_tool_move.cc
M  +5    -1    krita/plugins/tools/defaulttools/kis_tool_move.h
A  +132  -0    krita/plugins/tools/defaulttools/strokes/move_selection_stroke_strategy.cpp     [License: GPL (v2+)]
A  +49   -0    krita/plugins/tools/defaulttools/strokes/move_selection_stroke_strategy.h     [License: GPL (v2+)]
M  +2    -0    krita/ui/kis_doc2_p.h
M  +8    -0    krita/ui/kis_filter_handler.cc
M  +12   -0    krita/ui/tool/kis_tool.cc
M  +14   -0    krita/ui/tool/kis_tool.h

http://commits.kde.org/calligra/546a8c7ead456cd86a63b8853c424e230dfdad66