Bug 392717 - Krita's transformation tool does not treat vector object boundaries outside of canvas correctly
Summary: Krita's transformation tool does not treat vector object boundaries outside o...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools/Transform (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-04 13:13 UTC by Tyson Tan
Modified: 2019-09-21 13:11 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Krita's transformation tool does not treat vector object boundaries outside of canvas correctly (279.99 KB, image/png)
2018-04-04 13:13 UTC, Tyson Tan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tyson Tan 2018-04-04 13:13:39 UTC
Created attachment 111818 [details]
Krita's transformation tool does not treat vector object boundaries outside of canvas correctly

krita-4.1.0-pre-alpha-39cc9f9-x86_64.appimage

Krita's transformation tool does not treat vector object boundaries outsize of canvas correctly. When a vector object has part of it outside of canvas, the transformation tool only recognize its boundaries within the canvas. Although it also transform the part outside of canvas, but it is still very confusing.

I discovered this while using transformation tool as a workaround to fine-tune font-size.
Comment 1 Dmitry Kazakov 2018-04-05 12:56:44 UTC
The same thing happens with all the layers that use "prerender" tactics for its contents, e.g. Group Layers. If a group layer has some area outside image bounds, it is not updated during normal update runs. 

We might want to reuse KisLayerUtils::RefreshHiddenAreas to resolve this issue. It'll help with Group Layers, though will not help with group layers, but will not help with shape layers (if we don't do anything special to them).
Comment 2 Dmitry Kazakov 2019-09-18 13:53:26 UTC
Git commit b6d75fa13012121bd8a88c7be78956c81b9179ed by Dmitry Kazakov.
Committed on 18/09/2019 at 13:53.
Pushed by dkazakov into branch 'master'.

Fix outline of Group Layers in Move Tool and Transform Tool

If a group layer is outside the canvas area, we should regenerate these
hidden regions separately.

M  +42   -31   libs/image/kis_layer_utils.cpp
M  +2    -0    libs/image/kis_layer_utils.h
M  +1    -1    libs/ui/tool/strokes/move_stroke_strategy.cpp
M  +2    -2    plugins/tools/basictools/KisMoveBoundsCalculationJob.cpp
M  +1    -0    plugins/tools/tool_transform2/strokes/transform_stroke_strategy.cpp

https://invent.kde.org/kde/krita/commit/b6d75fa13012121bd8a88c7be78956c81b9179ed
Comment 3 Dmitry Kazakov 2019-09-19 18:12:15 UTC
Git commit 8c1b215d184161892f1293495e3f9d51dbcf96cf by Dmitry Kazakov.
Committed on 19/09/2019 at 18:05.
Pushed by dkazakov into branch 'master'.

Fix preview of Shape Layers in Transform Tool and Move Tool

This patch defines new "type" of layers, KisCroppedOriginalLayerInterface,
which tells that this layer may have some data outside layer bounds that
is not rendered normally. So the tools that want to use this data
should first call:

interface->forceUpdateHiddenAreaOnOriginal()

and wait until the layer generates this data.

M  +1    -0    libs/image/CMakeLists.txt
A  +22   -0    libs/image/KisCroppedOriginalLayerInterface.cpp     [License: GPL (v2+)]
A  +38   -0    libs/image/KisCroppedOriginalLayerInterface.h     [License: GPL (v2+)]
M  +13   -0    libs/image/kis_layer_utils.cpp
M  +2    -0    libs/image/kis_layer_utils.h
M  +5    -0    libs/ui/flake/kis_shape_layer.cc
M  +8    -1    libs/ui/flake/kis_shape_layer.h
M  +36   -6    libs/ui/flake/kis_shape_layer_canvas.cpp
M  +5    -0    libs/ui/flake/kis_shape_layer_canvas.h
M  +30   -8    libs/ui/tool/strokes/move_stroke_strategy.cpp
M  +7    -0    plugins/tools/tool_transform2/strokes/transform_stroke_strategy.cpp

https://invent.kde.org/kde/krita/commit/8c1b215d184161892f1293495e3f9d51dbcf96cf
Comment 4 Dmitry Kazakov 2019-09-21 12:09:07 UTC
Git commit 7fb80d3efcae12b10fa4084ea53e9820daca7e9a by Dmitry Kazakov.
Committed on 21/09/2019 at 10:06.
Pushed by dkazakov into branch 'krita/4.2'.

Fix preview of Shape Layers in Transform Tool and Move Tool

This patch defines new "type" of layers, KisCroppedOriginalLayerInterface,
which tells that this layer may have some data outside layer bounds that
is not rendered normally. So the tools that want to use this data
should first call:

interface->forceUpdateHiddenAreaOnOriginal()

and wait until the layer generates this data.

M  +1    -0    libs/image/CMakeLists.txt
A  +22   -0    libs/image/KisCroppedOriginalLayerInterface.cpp     [License: GPL (v2+)]
A  +38   -0    libs/image/KisCroppedOriginalLayerInterface.h     [License: GPL (v2+)]
M  +13   -0    libs/image/kis_layer_utils.cpp
M  +2    -0    libs/image/kis_layer_utils.h
M  +5    -0    libs/ui/flake/kis_shape_layer.cc
M  +8    -1    libs/ui/flake/kis_shape_layer.h
M  +36   -6    libs/ui/flake/kis_shape_layer_canvas.cpp
M  +5    -0    libs/ui/flake/kis_shape_layer_canvas.h
M  +30   -8    libs/ui/tool/strokes/move_stroke_strategy.cpp
M  +7    -0    plugins/tools/tool_transform2/strokes/transform_stroke_strategy.cpp

https://invent.kde.org/kde/krita/commit/7fb80d3efcae12b10fa4084ea53e9820daca7e9a
Comment 5 Dmitry Kazakov 2019-09-21 12:09:07 UTC
Git commit ba7501946d78974e1b96f4f44e4ce913f0c3636e by Dmitry Kazakov.
Committed on 21/09/2019 at 10:06.
Pushed by dkazakov into branch 'krita/4.2'.

Fix outline of Group Layers in Move Tool and Transform Tool

If a group layer is outside the canvas area, we should regenerate these
hidden regions separately.

# Conflicts:
#	libs/image/kis_layer_utils.cpp

M  +42   -29   libs/image/kis_layer_utils.cpp
M  +2    -0    libs/image/kis_layer_utils.h
M  +1    -1    libs/ui/tool/strokes/move_stroke_strategy.cpp
M  +2    -2    plugins/tools/basictools/KisMoveBoundsCalculationJob.cpp
M  +1    -0    plugins/tools/tool_transform2/strokes/transform_stroke_strategy.cpp

https://invent.kde.org/kde/krita/commit/ba7501946d78974e1b96f4f44e4ce913f0c3636e
Comment 6 Tyson Tan 2019-09-21 13:11:33 UTC
Thank you, Dmitry! :D