Bug 418317 - Copying a selection from a vector layer creates a normal layer
Summary: Copying a selection from a vector layer creates a normal layer
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools/Vector (show other bugs)
Version: 5.2.6
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-29 10:22 UTC by lenn.de.graef
Modified: 2024-11-14 15:33 UTC (History)
2 users (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 lenn.de.graef 2020-02-29 10:22:01 UTC
SUMMARY

When copying a selection from a vector layer with the "cut to new layer" or "copy to new layer" command creates a normal layer instead of a vector layer.

Additionally, when using the "cut to layer" command, the original is not actually cut, making it equivalent to the "copy to layer" command

STEPS TO REPRODUCE
1. Create a vector layer
2. draw a shape
3. use the rectangular selection tool
4. Right click and copy or cut or use Ctrl-Shift-J or Ctrl-alt-J

OBSERVED RESULT
The new layer is a normal layer

EXPECTED RESULT
The new layer should be a vector layer

SOFTWARE/OS VERSIONS
Windows: 10
Comment 1 Ahab Greybeard 2020-03-02 16:44:25 UTC
I can confirm this behaviour, as decribed.

However, these commands do not work if the vector objects are selected with the Select Shapes Tool, i.e selected as vector objects.

Also, if you use the rectangular selection tool (or the elliptical selection) to include only part of a vector object, it's the raster projection content of the selection that is copied to a new layer.
I can't imagine the cut option working in this case because that would mean performing some kind of split operation on the vector object.

It would seem that these commands are not intended to be used on a vector layer except to only copy the raster projection.
Comment 2 Vitamorus 2024-11-14 07:35:15 UTC
Re-confirmed for 5.2.6.
This is technically not a bug, I think, but it is a flaw in the UX.
Comment 3 Dmitry Kazakov 2024-11-14 15:30:37 UTC
Git commit 77de3be8980d78f26fe7c11d937c6d73d0d86159 by Dmitry Kazakov.
Committed on 14/11/2024 at 15:30.
Pushed by dkazakov into branch 'krita/5.2'.

Fix "Copy into new Layer" action when working with vector layers

Working with vector data is tricky, now the behavior is made more consistent:

1) If a vector layer is active and shape selection tool is active:
   a) "Copy into new Layer" copies a shape into the new layer
   b) Ctrl+C + Ctrl+V copies a shape into the same layer

2) If a vector layer is active, but no shape is selected in the tool
   a) both, "Copy into new Layer" and Ctrl+C+V copy raster data defined by
       the global selection into the new layer

M  +2    -2    krita/krita.action
M  +1    -1    libs/flake/KoShapeController.cpp
M  +2    -1    libs/flake/KoShapeControllerBase.cpp
M  +1    -1    libs/flake/KoShapeControllerBase.h
M  +21   -8    libs/ui/actions/KisPasteActionFactories.cpp
M  +14   -2    libs/ui/actions/KisPasteActionFactories.h
M  +14   -12   libs/ui/actions/kis_selection_action_factories.cpp
M  +14   -2    libs/ui/actions/kis_selection_action_factories.h
M  +2    -2    libs/ui/flake/kis_shape_controller.cpp
M  +1    -1    libs/ui/flake/kis_shape_controller.h
M  +10   -8    libs/ui/kis_selection_manager.cc

https://invent.kde.org/graphics/krita/-/commit/77de3be8980d78f26fe7c11d937c6d73d0d86159
Comment 4 Dmitry Kazakov 2024-11-14 15:33:18 UTC
Git commit 75b20e7594c4dfdeddf2d06668aac8d2a70a305d by Dmitry Kazakov.
Committed on 14/11/2024 at 15:33.
Pushed by dkazakov into branch 'master'.

Fix "Copy into new Layer" action when working with vector layers

Working with vector data is tricky, now the behavior is made more consistent:

1) If a vector layer is active and shape selection tool is active:
   a) "Copy into new Layer" copies a shape into the new layer
   b) Ctrl+C + Ctrl+V copies a shape into the same layer

2) If a vector layer is active, but no shape is selected in the tool
   a) both, "Copy into new Layer" and Ctrl+C+V copy raster data defined by
       the global selection into the new layer

# Conflicts:
#	libs/ui/actions/kis_selection_action_factories.cpp

M  +2    -2    krita/krita.action
M  +1    -1    libs/flake/KoShapeController.cpp
M  +2    -1    libs/flake/KoShapeControllerBase.cpp
M  +1    -1    libs/flake/KoShapeControllerBase.h
M  +21   -8    libs/ui/actions/KisPasteActionFactories.cpp
M  +14   -2    libs/ui/actions/KisPasteActionFactories.h
M  +16   -13   libs/ui/actions/kis_selection_action_factories.cpp
M  +14   -2    libs/ui/actions/kis_selection_action_factories.h
M  +2    -2    libs/ui/flake/kis_shape_controller.cpp
M  +1    -1    libs/ui/flake/kis_shape_controller.h
M  +10   -8    libs/ui/kis_selection_manager.cc

https://invent.kde.org/graphics/krita/-/commit/75b20e7594c4dfdeddf2d06668aac8d2a70a305d