https://bugs.kde.org/show_bug.cgi?id=411394

Dmitry Kazakov <dimul...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|CONFIRMED                   |RESOLVED
      Latest Commit|                            |https://invent.kde.org/grap
                   |                            |hics/krita/commit/a87dced5f
                   |                            |88f26e282dfc86d18a3c32ecf68
                   |                            |fa96
         Resolution|---                         |FIXED

--- Comment #7 from Dmitry Kazakov <dimul...@gmail.com> ---
Git commit a87dced5f88f26e282dfc86d18a3c32ecf68fa96 by Dmitry Kazakov.
Committed on 29/05/2020 at 11:34.
Pushed by dkazakov into branch 'master'.

Fix undo breakage after converting a pixel selecion into a vector one

Since 2013, when a selection is switched into a vector mode, its pixel
selection is used as a projection. It is done intentionally, because we
need a way to auto-flatten selection when someone opens a transaction on
this devices. It lets all our painting tools work on selections smoothly
without any conversions.

And this switching used to break undo on the projection device. Obviously,
the vectors are rendered on the device without any transactions, so we
cannot undo them.

To overcome this issue, a special mechanism "reincarnation with detached
history" for paint devices was introduced
(KisPaintDevice::reincarnateWithDetachedHistory). When a device reincarnates,
it starts a new undo history from scratch.The old undo history is kept
intact inside the returned command, so the device can later be recovered
to its original state.

As a consequence, there is an important API change in KisSelection,
now the seleciton should be converted to vector mode explicitly and
undo command for it should be kept in the common image's undo history
(that was the reason of the previous huge patch for KoShapeControllerBase).

M  +15   -0    libs/image/kis_paint_device.cc
M  +19   -0    libs/image/kis_paint_device.h
M  +40   -0    libs/image/kis_paint_device_data.h
M  +152  -28   libs/image/kis_selection.cc
M  +20   -5    libs/image/kis_selection.h
M  +38   -19   libs/image/kis_transaction_data.cpp
M  +2    -0    libs/image/kis_transaction_data.h
M  +1    -6    libs/image/tests/CMakeLists.txt
M  +6    -5    libs/image/tests/kis_selection_test.cpp
M  +2    -2    libs/libkis/Selection.cpp
M  +2    -6    libs/ui/flake/kis_shape_controller.cpp
M  +0    -4    libs/ui/flake/kis_shape_selection_model.cpp
M  +1    -1    libs/ui/kis_selection_decoration.cc
M  +3    -3    libs/ui/kis_selection_manager.cc
M  +167  -18   libs/ui/tests/kis_shape_selection_test.cpp
M  +2    -0    libs/ui/tests/kis_shape_selection_test.h
M  +1    -1    libs/ui/tests/util.h
M  +1    -1    plugins/impex/libkra/kis_kra_load_visitor.cpp
M  +2    -2    plugins/impex/libkra/kis_kra_save_visitor.cpp
M  +2    -2    plugins/impex/libkra/tests/kis_kra_saver_test.cpp
M  +4    -4    plugins/impex/libkra/tests/util.h

https://invent.kde.org/graphics/krita/commit/a87dced5f88f26e282dfc86d18a3c32ecf68fa96

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to