Bug 315255 - jj: Enable the use of keyboard shortcuts to control the shape of selection while selecting with the "Select a polygonal region" tool.
Summary: jj: Enable the use of keyboard shortcuts to control the shape of selection wh...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Usability (show other bugs)
Version: unspecified
Platform: Other Unspecified
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2013-02-16 03:00 UTC by honoomahoujutsushi
Modified: 2015-06-21 13:51 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
GIMP's lasso tool in use. (98.25 KB, image/jpeg)
2013-02-16 03:02 UTC, honoomahoujutsushi
Details
GIMP's lasso tool with the selection paths modified. (99.01 KB, image/jpeg)
2013-02-16 03:04 UTC, honoomahoujutsushi
Details
Path selection completed. (99.98 KB, image/jpeg)
2013-02-16 03:06 UTC, honoomahoujutsushi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description honoomahoujutsushi 2013-02-16 03:00:45 UTC
Use case: The use of keyboard shortcuts while selecting a region using the aforementioned "Select a polygonal region" tool should be made possible in order to manipulate the shape of the selection while using it.

Examples: GIMP's lasso tool is able to change the paths of the selection while the tool is in use. To elaborate:

- Backspace while making the selection erases the last path point up till zero (as in the beginning of the path)

- Enter finishes the selection

- ESC key cancels the selection in progress

Enabling this will ease the use of the tool as compared to its present state, which basically does not offer such features - yet.

Reproducible: Always
Comment 1 honoomahoujutsushi 2013-02-16 03:02:46 UTC
Created attachment 77351 [details]
GIMP's lasso tool in use.

GIMP's lasso tool in use.
Comment 2 honoomahoujutsushi 2013-02-16 03:04:45 UTC
Created attachment 77352 [details]
GIMP's lasso tool with the selection paths modified.

GIMP's lasso tool with the selection paths modified. In this screenshot I have pressed Backspace about three times, thus modifying the current shape of the path as it is now.
Comment 3 honoomahoujutsushi 2013-02-16 03:06:40 UTC
Created attachment 77353 [details]
Path selection completed.

Path selection completed. For GIMP, this is possible by pressing the Enter button which can be done anytime before you finish the selection.
Comment 4 Halla Rempt 2013-02-16 08:06:44 UTC
Yes, this is actually a regression, I think -- the tool Emanuelle Tamponi did for 1.6 had this feature to a certain extent, but we did not port those tools because we wanted to move the functionality to the shared tools.
Comment 5 honoomahoujutsushi 2013-02-16 12:53:04 UTC
On Sat Feb 16 2013 04:06:44 PM MYT, Boudewijn Rempt <boud@valdyas.org> wrote:

> https://bugs.kde.org/show_bug.cgi?id=315255

> --- Comment #4 from Boudewijn Rempt <boud@valdyas.org> ---
> Yes, this is actually a regression, I think -- the tool Emanuelle
> Tamponi did for 1.6 had this feature to a certain extent, but we did not
> port those tools because we wanted to move the functionality to the
> shared tools.
> 
> -- 
> You are receiving this mail because:
> You reported the bug.

Thanks! By the way, I suppose this could also be applied for the pen tool while making paths. ... My memory fails me on whether Krita has a pen tool or not, but I do remember there's a path-based selection tool. Perhaps this could come into consideration...
Comment 6 Halla Rempt 2015-05-18 08:33:52 UTC
Git commit 433b6a66a701ca0f9d9e79e31d729700fb239a2a by Boudewijn Rempt.
Committed on 18/05/2015 at 08:33.
Pushed by rempt into branch 'calligra/2.9'.

Add basic modifier key support to selection tools.

Patch by Michael Abrahams. Thanks!
CCMAIL: miabraha@gmail.com
REVIEW: 123833

This refactors polygonal, elliptical, and rectangular selection tools to
use a basic selection tool template which unifies previously duplicated
code. The template overrides the ability to execute alternate actions, but
none of those tools supported alternate actions previously and the ellipse
and rectangle were already overriding the modifier keys to begin with.

Shift: add to selection Alt: subtract from selection Shift+Alt: intersect
current selection Ctrl: replace selection

Certain key combinations allow users the ability to expose the modifier
keys to the base tool, i.e. to make proportional / translated / scaled
alterations using ctrl/alt/shift.

1) If the user clicks first and then presses modifier keys, those modifier
keys will only alter the selection method.

2) If the user presses modifier keys first and then clicks, the selection
method is locked in, and subsequent modifier keystrokes will change how
the selection is drawn.

3) If the underlying tool never takes modifier keys, modifier keys will
always alter the selection method.

These rules can be defined systematically by modifying the template.
Things to do later:

+ Basic functionality is implemented in KisToolSelectBase, which covers
the outline, contiguous, similar color and path selection tools which
inherit from KisToolSelectBase.  A more complete refactoring might define
KisToolSelectBase via the selection tool template, but it is not simple
for the path selection tool which uses a more complicated delegated
design pattern.

+ The tools need new icons (e.g. little plus/minus symbols) to give
users visual feedback when they activate the modifiers.

+ The Ctrl key should switch temporarily to the move tool, as in
Photoshop.

+ Check idiomatic naming conventions, style, etc.

The ability to add, subtract and intersect complicated shapes quickly
exposes some bugs in how the selection marquees are drawn: sometimes
extra lines are drawn, sometimes lines fail to be drawn.

M  +2    -1    krita/image/kis_selection.h
M  +29   -22   krita/plugins/tools/selectiontools/kis_tool_select_elliptical.cc
M  +27   -12   krita/plugins/tools/selectiontools/kis_tool_select_elliptical.h
M  +1    -0    krita/plugins/tools/selectiontools/kis_tool_select_path.cc
M  +29   -41   krita/plugins/tools/selectiontools/kis_tool_select_polygonal.cc
M  +23   -16   krita/plugins/tools/selectiontools/kis_tool_select_polygonal.h
M  +26   -42   krita/plugins/tools/selectiontools/kis_tool_select_rectangular.cc
M  +21   -16   krita/plugins/tools/selectiontools/kis_tool_select_rectangular.h
M  +7    -2    krita/ui/input/kis_alternate_invocation_action.cpp
M  +1    -0    krita/ui/input/kis_alternate_invocation_action.h
A  +179  -0    krita/ui/tool/kis_selection_action_template.h     [License: UNKNOWN]  *
M  +4    -4    krita/ui/tool/kis_tool_paint.h
M  +12   -0    krita/ui/tool/kis_tool_polyline_base.cpp
M  +3    -0    krita/ui/tool/kis_tool_polyline_base.h
M  +13   -3    krita/ui/tool/kis_tool_rectangle_base.cpp
M  +3    -0    krita/ui/tool/kis_tool_rectangle_base.h
M  +78   -1    krita/ui/tool/kis_tool_select_base.cpp
M  +9    -1    krita/ui/tool/kis_tool_select_base.h

The files marked with a * at the end have a non valid license. Please read: http://techbase.kde.org/Policies/Licensing_Policy and use the headers which are listed at that page.


http://commits.kde.org/calligra/433b6a66a701ca0f9d9e79e31d729700fb239a2a
Comment 7 Halla Rempt 2015-05-26 08:47:34 UTC
Git commit 9b8267551118abb86f4fabcdad0cfd6602c14122 by Boudewijn Rempt.
Committed on 26/05/2015 at 08:45.
Pushed by rempt into branch 'calligra/2.9'.

Add basic modifier key support to selection tools

This refactors polygonal, elliptical, and rectangular selection tools to
use a basic selection tool template which unifies previously duplicated
code. The template overrides the ability to execute alternate actions, but
none of those tools supported alternate actions previously and the ellipse
and rectangle were already overriding the modifier keys to begin with.

Shift: add to selection

Alt: subtract from selection

Shift+Alt: intersect current selection

Ctrl: replace selection

Certain key combinations allow users the ability to expose the modifier
keys to the base tool, i.e. to make proportional / translated / scaled
alterations using ctrl/alt/shift.

1) If the user clicks first and then presses modifier keys, those modifier
keys will only alter the selection method.

2) If the user presses modifier keys first and then clicks, the selection
method is locked in, and subsequent modifier keystrokes will change how
the selection is drawn.

3) If the underlying tool never takes modifier keys, modifier keys will
always alter the selection method.

Note: the bezier curve selection tool doesn't support the modifiers yet.

Patch by Michael Abrahams. Thanks!
CCMAIL: miabraha@gmail.com
REVIEW: 123833

M  +2    -1    krita/image/kis_selection.h
M  +25   -10   krita/plugins/tools/selectiontools/kis_tool_select_contiguous.cc
M  +10   -4    krita/plugins/tools/selectiontools/kis_tool_select_contiguous.h
M  +30   -22   krita/plugins/tools/selectiontools/kis_tool_select_elliptical.cc
M  +29   -13   krita/plugins/tools/selectiontools/kis_tool_select_elliptical.h
M  +32   -4    krita/plugins/tools/selectiontools/kis_tool_select_outline.cc
M  +9    -5    krita/plugins/tools/selectiontools/kis_tool_select_outline.h
M  +1    -0    krita/plugins/tools/selectiontools/kis_tool_select_path.cc
M  +1    -0    krita/plugins/tools/selectiontools/kis_tool_select_path.h
M  +30   -41   krita/plugins/tools/selectiontools/kis_tool_select_polygonal.cc
M  +21   -16   krita/plugins/tools/selectiontools/kis_tool_select_polygonal.h
M  +29   -44   krita/plugins/tools/selectiontools/kis_tool_select_rectangular.cc
M  +19   -16   krita/plugins/tools/selectiontools/kis_tool_select_rectangular.h
M  +23   -8    krita/plugins/tools/selectiontools/kis_tool_select_similar.cc
M  +18   -10   krita/plugins/tools/selectiontools/kis_tool_select_similar.h
M  +0    -1    krita/ui/CMakeLists.txt
M  +5    -0    krita/ui/input/kis_alternate_invocation_action.cpp
M  +1    -0    krita/ui/input/kis_alternate_invocation_action.h
M  +8    -0    krita/ui/tool/kis_tool.cc
M  +4    -0    krita/ui/tool/kis_tool.h
M  +4    -4    krita/ui/tool/kis_tool_paint.h
M  +12   -0    krita/ui/tool/kis_tool_polyline_base.cpp
M  +3    -0    krita/ui/tool/kis_tool_polyline_base.h
M  +13   -3    krita/ui/tool/kis_tool_rectangle_base.cpp
M  +3    -0    krita/ui/tool/kis_tool_rectangle_base.h
D  +0    -79   krita/ui/tool/kis_tool_select_base.cpp
M  +175  -21   krita/ui/tool/kis_tool_select_base.h

http://commits.kde.org/calligra/9b8267551118abb86f4fabcdad0cfd6602c14122
Comment 8 Halla Rempt 2015-06-21 13:51:02 UTC
Git commit a7f5592308fa8e841f444106a15f37ffa66ae001 by Boudewijn Rempt.
Committed on 21/06/2015 at 13:50.
Pushed by rempt into branch 'calligra/2.9'.

Third time! The Selection modifiers patch!!!

This refactors polygonal, elliptical, and rectangular selection tools to
use a basic selection tool template which unifies previously duplicated
code. The template overrides the ability to execute alternate actions, but
none of those tools supported alternate actions previously and the ellipse
and rectangle were already overriding the modifier keys to begin with.

Shift: add to selection

Alt: subtract from selection

Shift+Alt: intersect current selection

Ctrl: replace selection

Certain key combinations allow users the ability to expose the modifier
keys to the base tool, i.e. to make proportional / translated / scaled
alterations using ctrl/alt/shift.

1) If the user clicks first and then presses modifier keys, those modifier
keys will only alter the selection method.

2) If the user presses modifier keys first and then clicks, the selection
method is locked in, and subsequent modifier keystrokes will change how
the selection is drawn.

3) If the underlying tool never takes modifier keys, modifier keys will
always alter the selection method.

Note: the bezier curve selection tool doesn't support the modifiers yet.

Patch by Michael Abrahams. Thanks!
CCMAIL: miabraha@gmail.com
CCMAIL: kimageshop@kde.org
CCMAIL: animtim@gmail.com, info@davidrevoy.com
REVIEW: 123833
Related: bug 348234

NOTE: Changing the secondary invocation action is still broken, but that's
not the fault of this patch, that's another bug!

M  +2    -1    krita/image/kis_selection.h
M  +14   -0    krita/plugins/tools/defaulttools/kis_tool_path.cc
M  +4    -1    krita/plugins/tools/defaulttools/kis_tool_path.h
M  +25   -10   krita/plugins/tools/selectiontools/kis_tool_select_contiguous.cc
M  +9    -4    krita/plugins/tools/selectiontools/kis_tool_select_contiguous.h
M  +30   -22   krita/plugins/tools/selectiontools/kis_tool_select_elliptical.cc
M  +29   -13   krita/plugins/tools/selectiontools/kis_tool_select_elliptical.h
M  +32   -4    krita/plugins/tools/selectiontools/kis_tool_select_outline.cc
M  +10   -5    krita/plugins/tools/selectiontools/kis_tool_select_outline.h
M  +30   -4    krita/plugins/tools/selectiontools/kis_tool_select_path.cc
M  +18   -12   krita/plugins/tools/selectiontools/kis_tool_select_path.h
M  +30   -41   krita/plugins/tools/selectiontools/kis_tool_select_polygonal.cc
M  +21   -16   krita/plugins/tools/selectiontools/kis_tool_select_polygonal.h
M  +29   -44   krita/plugins/tools/selectiontools/kis_tool_select_rectangular.cc
M  +20   -16   krita/plugins/tools/selectiontools/kis_tool_select_rectangular.h
M  +23   -8    krita/plugins/tools/selectiontools/kis_tool_select_similar.cc
M  +18   -10   krita/plugins/tools/selectiontools/kis_tool_select_similar.h
M  +0    -1    krita/ui/CMakeLists.txt
M  +8    -3    krita/ui/canvas/kis_tool_proxy.h
M  +1    -0    krita/ui/input/kis_alternate_invocation_action.cpp
M  +0    -1    krita/ui/input/kis_input_manager.cpp
M  +1    -1    krita/ui/tool/kis_delegated_tool.h
M  +8    -0    krita/ui/tool/kis_tool.cc
M  +11   -1    krita/ui/tool/kis_tool.h
M  +4    -4    krita/ui/tool/kis_tool_paint.h
M  +12   -0    krita/ui/tool/kis_tool_polyline_base.cpp
M  +3    -0    krita/ui/tool/kis_tool_polyline_base.h
M  +34   -24   krita/ui/tool/kis_tool_rectangle_base.cpp
M  +8    -5    krita/ui/tool/kis_tool_rectangle_base.h
D  +0    -79   krita/ui/tool/kis_tool_select_base.cpp
M  +185  -18   krita/ui/tool/kis_tool_select_base.h
M  +19   -7    libs/basicflakes/tools/KoCreatePathTool.cpp
M  +9    -2    libs/basicflakes/tools/KoCreatePathTool.h
M  +7    -5    libs/basicflakes/tools/KoCreatePathTool_p.h

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