Review Request 123833: Krita: Add basic modifier key support to selection tools.

Michael Abrahams miabraha at gmail.com
Fri Jun 19 21:55:08 BST 2015


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/123833/
-----------------------------------------------------------

(Updated June 19, 2015, 8:55 p.m.)


Review request for Calligra.


Changes
-------

Sorry for the long radio silence - I got thrown off when I realized changing the select path tool would be as much work as the rest of the patch.  Luckily the changes I dug out will also improve the functionality of the select path tool, and it no longer cancels the stroke when the shift key is held on the first click.

In the newest diff I've tried to clean away any unnecessary changes to the basic alternate action selection mechanism, hopefully this fixes any spillover.


Repository: calligra


Description (updated)
-------

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, e.g. to make proportional / translated / scaled alterations using ctrl/alt/shift.
1) Any modifier keys held *when the tool is first activated* will determine the new selection method.  
2) If the underlying tool *does not take modifier keys*, pressing modifier keys in the middle of a stroke will change the selection method.  This applies to the lasso tool and polygon tool. 
3) If the underlying tool *takes modifier keys,* they will always be forwarded to the underlying tool, and it is not possible to change the selection method in the middle of a stroke.

Things to do in another patch: 
+ The Ctrl key should switch temporarily to the move tool, Ctrl+Alt can be used to force replacing selection.


Diffs (updated)
-----

  CMakeFiles/2.8.12.1/CMakeDetermineCompilerABI_CXX.bin PRE-CREATION 
  krita/image/kis_selection.h 6376f874 
  krita/plugins/tools/defaulttools/kis_tool_path.h 468aca3 
  krita/plugins/tools/defaulttools/kis_tool_path.cc f05b4eb 
  krita/plugins/tools/selectiontools/kis_tool_select_contiguous.h 26310e2 
  krita/plugins/tools/selectiontools/kis_tool_select_contiguous.cc 5bd4d2f 
  krita/plugins/tools/selectiontools/kis_tool_select_elliptical.h 7b2cd2f 
  krita/plugins/tools/selectiontools/kis_tool_select_elliptical.cc 999f1a0 
  krita/plugins/tools/selectiontools/kis_tool_select_outline.h 4756870 
  krita/plugins/tools/selectiontools/kis_tool_select_outline.cc 46cca47 
  krita/plugins/tools/selectiontools/kis_tool_select_path.h a67b584 
  krita/plugins/tools/selectiontools/kis_tool_select_path.cc 9f1a65c 
  krita/plugins/tools/selectiontools/kis_tool_select_polygonal.h feee9cb 
  krita/plugins/tools/selectiontools/kis_tool_select_polygonal.cc 9acca50 
  krita/plugins/tools/selectiontools/kis_tool_select_rectangular.h 5e88766 
  krita/plugins/tools/selectiontools/kis_tool_select_rectangular.cc 331c6a4 
  krita/plugins/tools/selectiontools/kis_tool_select_similar.h f701986 
  krita/plugins/tools/selectiontools/kis_tool_select_similar.cc b2c51d9 
  krita/ui/CMakeLists.txt a2a293e 
  krita/ui/canvas/kis_tool_proxy.h dacadd8 
  krita/ui/input/kis_alternate_invocation_action.cpp 48723bf 
  krita/ui/input/kis_input_manager.cpp 08a056e 
  krita/ui/tool/kis_delegated_tool.h 20c690a 
  krita/ui/tool/kis_tool.h b4fe908 
  krita/ui/tool/kis_tool.cc f336241 
  krita/ui/tool/kis_tool_paint.h 4c42ef9 
  krita/ui/tool/kis_tool_polyline_base.h f681fd8 
  krita/ui/tool/kis_tool_polyline_base.cpp 6071f76 
  krita/ui/tool/kis_tool_rectangle_base.h a0b470c 
  krita/ui/tool/kis_tool_rectangle_base.cpp 8e091d0 
  krita/ui/tool/kis_tool_select_base.h 500d6dd 
  krita/ui/tool/kis_tool_select_base.cpp 40779ad 
  libs/basicflakes/tools/KoCreatePathTool.h ec03ebc 
  libs/basicflakes/tools/KoCreatePathTool.cpp 1ababf7 
  libs/basicflakes/tools/KoCreatePathTool_p.h 4cf9e0c 

Diff: https://git.reviewboard.kde.org/r/123833/diff/


Testing (updated)
-------

There are no tests targeting the individual selection tools, but the tests for other individual tools passed.

These tools give the ability to add, subtract and intersect complicated shapes quickly. Doing so exposes some bugs in how selection marquees are drawn, particularly disappearing lines.


Thanks,

Michael Abrahams

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20150619/620bc961/attachment.htm>


More information about the calligra-devel mailing list