Bug 478735 - "Convert shapes to vector selection" ignores transform and coordinate change
Summary: "Convert shapes to vector selection" ignores transform and coordinate change
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools/Vector (show other bugs)
Version: 5.2.2
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-19 17:42 UTC by paleh
Modified: 2024-01-16 14:11 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description paleh 2023-12-19 17:42:48 UTC
SUMMARY
Doing "Convert shapes to vector selection" on a vector object makes the selection appear at the position where the object was defined rather than where the object is located currently.

STEPS TO REPRODUCE
1. Create a vector object on a vector layer
Either:
   2.a.  Apply any transform (including moving) on the object using the transform tool or
   2.b. Change the object's position relative to the origin of the canvas by rescaling or mirroring the canvas
3. Select the object with the Select shapes tool
4. Do Select->Convert shapes to vector selection

OBSERVED RESULT
The selection appears where the object was created.

EXPECTED RESULT
The selection appears around the object.

SOFTWARE/OS VERSIONS
Linux: Ubuntu 22.04
Qt Version: 5.15.7
Appimage

ADDITIONAL INFORMATION
Saving and reopening the document and doing steps 3-4 makes the selection appear at the expected position.
This was present in 5.1.5 and is present on master (git-1fc417ae3e)
Comment 1 Dmitry Kazakov 2024-01-16 14:11:50 UTC
Git commit 89e0021dc469d938ee6fb683ce102d7eb6f725af by Dmitry Kazakov.
Committed on 16/01/2024 at 14:50.
Pushed by dkazakov into branch 'master'.

Fix conversion of the shape into a vector selection

We should bake the shape's absolute transform during the conversion

M  +13   -1    libs/ui/actions/kis_selection_action_factories.cpp

https://invent.kde.org/graphics/krita/-/commit/89e0021dc469d938ee6fb683ce102d7eb6f725af
Comment 2 Dmitry Kazakov 2024-01-16 14:11:51 UTC
Git commit e2e42b0d01f4d3f9b15791f6f4705aeb2eb230cb by Dmitry Kazakov.
Committed on 16/01/2024 at 15:11.
Pushed by dkazakov into branch 'master'.

Deduplicate shape cloning algorithm

Now we have KoShape::cloneShapeAndBakeAbsoluteTransform() if we want
to bake the transform as well.

M  +1    -11   libs/flake/KoDrag.cpp
M  +16   -0    libs/flake/KoShape.cpp
M  +14   -0    libs/flake/KoShape.h
M  +1    -12   libs/ui/actions/kis_selection_action_factories.cpp

https://invent.kde.org/graphics/krita/-/commit/e2e42b0d01f4d3f9b15791f6f4705aeb2eb230cb