Bug 391292

Summary: Shape Selection tool cannot edit shapes on a selection mask.
Product: [Applications] krita Reporter: wolthera <griffinvalley>
Component: Layers/VectorAssignee: Dmitry Kazakov <dimula73>
Status: RESOLVED FIXED    
Severity: normal CC: halla, raghu
Priority: NOR    
Version: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description wolthera 2018-03-02 12:35:16 UTC
To reproduce.

1. Make a selection with the selection tools, with the selection set to 'vector'.
2. Select the global selection mask.
3. Select the shape select tool.
4. Try to select the shape on the global selection mask.

I though initially it was because of that floating popup thing, but the following patch makes NO difference for me when it comes to actually selecting the shape on the selection mask.

-----------------------------------------------------------------------------

diff --git a/plugins/tools/defaulttool/defaulttool/DefaultTool.cpp b/plugins/tools/defaulttool/defaulttool/DefaultTool.cpp
index bffae46..e800e22 100644
--- a/plugins/tools/defaulttool/defaulttool/DefaultTool.cpp
+++ b/plugins/tools/defaulttool/defaulttool/DefaultTool.cpp
@@ -677,12 +677,12 @@ void DefaultTool::paint(QPainter &painter, const KoViewConverter &converter)
     // this tool only works on a vector layer right now, so give a warning if another layer type is trying to use it
     KisNodeSP currentNode = canvas()->resourceManager()->resource(KisCanvasResourceProvider::CurrentKritaNode).value<KisNodeWSP>();
 
-    if (currentNode.isNull() || !currentNode->inherits("KisShapeLayer")) {
+    if (currentNode.isNull() || (!currentNode->inherits("KisShapeLayer") && !currentNode->inherits("KisSelectionMask"))) {
 
         KisCanvas2 * kiscanvas = static_cast<KisCanvas2*>(canvas());
         kiscanvas->viewManager()->showFloatingMessage(
             i18n("This tool only works on vector layers. You probably want the move tool."),
-            QIcon(), 2000, KisFloatingMessage::Medium, Qt::AlignCenter);
+            QIcon(), 500, KisFloatingMessage::Medium, Qt::AlignCenter);
 
         return;
     }
Comment 1 wolthera 2018-03-02 12:40:55 UTC
For some reason, select->convert to vector selection is active and does nothing in 4.0.

In 3.3.3, I first had to convert to vector selection(despite making a vector selection to begin with), but after that I could select it...
Comment 2 Dmitry Kazakov 2018-04-06 13:05:34 UTC
There is also a weird assert when I try to create a vector selection...
Comment 3 Dmitry Kazakov 2018-04-06 13:52:29 UTC
Git commit aa81a25fd338f49901dd09c551c48cc6e8fd37f6 by Dmitry Kazakov.
Committed on 06/04/2018 at 13:51.
Pushed by dkazakov into branch 'master'.

Fix an assert when creating a vector selection

The problem is that selectionChanged() signal may easily arrive
later than some GUI code requests the shape manager, therefore the
assert will register an inconsistent state (which is actually, yes,
inconsistent)

M  +15   -6    libs/ui/canvas/kis_canvas2.cpp

https://commits.kde.org/krita/aa81a25fd338f49901dd09c551c48cc6e8fd37f6
Comment 4 Dmitry Kazakov 2018-04-07 13:45:41 UTC
Git commit 231608eda1d253309825cd96459a9a92a89273a1 by Dmitry Kazakov.
Committed on 07/04/2018 at 13:28.
Pushed by dkazakov into branch 'krita/4.0'.

Fix an assert when creating a vector selection

The problem is that selectionChanged() signal may easily arrive
later than some GUI code requests the shape manager, therefore the
assert will register an inconsistent state (which is actually, yes,
inconsistent)

M  +15   -6    libs/ui/canvas/kis_canvas2.cpp

https://commits.kde.org/krita/231608eda1d253309825cd96459a9a92a89273a1
Comment 5 Raghavendra kamath 2018-08-10 11:31:14 UTC
+1 Earlier i could edit the selection (resize and move) with the shape selection tool now the functionality is not there incidentally if I double click the selection I can enter in to node editing.
Comment 6 Dmitry Kazakov 2018-09-21 10:19:26 UTC
The bug is fixed now in master :)