Bug 417016

Summary: Display of shapes goes crazy if you use move tool or transform tool on vector layer
Product: [Applications] krita Reporter: acc4commissions
Component: Layers/VectorAssignee: Dmitry Kazakov <dimula73>
Status: RESOLVED FIXED    
Severity: normal CC: halla
Priority: NOR Keywords: regression, release_blocker
Version: nightly build (please specify the git hash!)   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: recording

Description acc4commissions 2020-02-01 09:58:43 UTC
Created attachment 125585 [details]
recording

SUMMARY
git 2fea6a9

It doesn't happen in git 7572e2d. So I guess it's newly introduced.

STEPS TO REPRODUCE
1. Make a vector layer and draw shapes on it.
2. Use Move Tool or Transform Tool on those shapes.
3. Try to move or transfrom the shapes again with Select Shapes Tool.

OBSERVED RESULT
Display of shapes goes crazy. (See the attatched video)

EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 acc4commissions 2020-02-01 11:24:50 UTC
I personally don't see the point of being able to use move tool & transform tool on vector layer in the first place though. :P
Comment 2 Halla Rempt 2020-02-01 12:20:38 UTC
Well, it's a regression, so assigning to Dmitry.
Comment 3 Dmitry Kazakov 2020-02-04 18:14:07 UTC
Git commit 09519feaf10804d7242a44e36b472aa13e809055 by Dmitry Kazakov.
Committed on 04/02/2020 at 18:13.
Pushed by dkazakov into branch 'master'.

Fix transformatoion of shapes that come from transforming the layer itself

Since we don't clone the root layer's shape, when cloning them, we should
manually apply the transformation of the root, from which we detach them.

M  +11   -1    libs/flake/KoShapeManager.cpp

https://invent.kde.org/kde/krita/commit/09519feaf10804d7242a44e36b472aa13e809055
Comment 4 Dmitry Kazakov 2020-02-05 17:09:13 UTC
Git commit b4951fc120f711e0d067784d25497f681dcd96ca by Dmitry Kazakov.
Committed on 05/02/2020 at 17:08.
Pushed by dkazakov into branch 'master'.

Fix threading issue in KisShapeLayer::transform()

The transformation itself should happen in the GUI thread, not in the
worker thread. Therefore we should use Qt::BlockingQueuedConnection.
It is not entirely safe (it can theoretically cause deadlocks), but it
is the only way how we can resolve the issue with keeping GUI thread the
only writer to the shapes.

The patch also fixes the problem in KisShapeLayerCanvas::forceRepaint() and
KisShapeLayerCanvas::forceRepaintWithHiddenAreas(), which should also
initiate the update in the GUI thread, not in the worker thread.

M  +44   -36   libs/ui/flake/kis_shape_layer.cc
M  +9    -0    libs/ui/flake/kis_shape_layer.h
M  +5    -4    libs/ui/flake/kis_shape_layer_canvas.cpp
M  +1    -1    libs/ui/flake/kis_shape_layer_canvas.h

https://invent.kde.org/kde/krita/commit/b4951fc120f711e0d067784d25497f681dcd96ca
Comment 5 Dmitry Kazakov 2020-02-05 17:09:13 UTC
Git commit 57e68a90f578f97f91b1344bf92c9ff43206bd12 by Dmitry Kazakov.
Committed on 05/02/2020 at 17:08.
Pushed by dkazakov into branch 'master'.

Fix rendering of Transform Tool for Shape Layers in continued stroke

When forcing the hidden areas update we should also update the areas
that were requested explicitly. Otherwise dirty areas of the projection
will not be updated.

M  +1    -1    libs/ui/flake/kis_shape_layer_canvas.cpp

https://invent.kde.org/kde/krita/commit/57e68a90f578f97f91b1344bf92c9ff43206bd12
Comment 6 Dmitry Kazakov 2020-02-05 17:09:13 UTC
Git commit 424214e81cff3b6d63c7243a22f1a894394e067a by Dmitry Kazakov.
Committed on 05/02/2020 at 17:08.
Pushed by dkazakov into branch 'master'.

Fix update of shape layer after cancelling transform tool action

Normally, setDirty() is called by TransformData(), but during cancel
operation we don't apply transformations, so we should issue an update
manually.

M  +3    -0    plugins/tools/tool_transform2/strokes/transform_stroke_strategy.cpp

https://invent.kde.org/kde/krita/commit/424214e81cff3b6d63c7243a22f1a894394e067a
Comment 7 Dmitry Kazakov 2020-02-06 16:55:07 UTC
Git commit 8f9386edc79ce4c104d646b60dc080f2c475a3cb by Dmitry Kazakov.
Committed on 06/02/2020 at 16:51.
Pushed by dkazakov into branch 'krita/4.2'.

Fix update of shape layer after cancelling transform tool action

Normally, setDirty() is called by TransformData(), but during cancel
operation we don't apply transformations, so we should issue an update
manually.

M  +3    -0    plugins/tools/tool_transform2/strokes/transform_stroke_strategy.cpp

https://invent.kde.org/kde/krita/commit/8f9386edc79ce4c104d646b60dc080f2c475a3cb
Comment 8 Dmitry Kazakov 2020-02-06 16:55:07 UTC
Git commit ba88e9315afbf6076ad7cb7d1c753f34bf6555ec by Dmitry Kazakov.
Committed on 06/02/2020 at 16:54.
Pushed by dkazakov into branch 'krita/4.2'.

Fix rendering of Transform Tool for Shape Layers in continued stroke

When forcing the hidden areas update we should also update the areas
that were requested explicitly. Otherwise dirty areas of the projection
will not be updated.

This patch is a ported version of 57e68a90f

M  +1    -1    libs/ui/flake/kis_shape_layer_canvas.cpp

https://invent.kde.org/kde/krita/commit/ba88e9315afbf6076ad7cb7d1c753f34bf6555ec