Fix undo breakage after converting a pixel selecion into a vector one
This is a fix for bug https://bugs.kde.org/show_bug.cgi?id=411394
The patch set fixes undo on the selection masks, when the user mixes vector and raster selection modes on the same selection mask.
NOTE: the patchset is based on krita/4.3, but it will be merged into master only! The only reason for using krita/4.3 is that unittests don't work on master, so it is impossible to test stuff there.
Technical details
- Refactor out KoShapeControllerBase to support undoing conversion of selections from raster to vector mode
- Use this undo capabilities and reincarnate pixel selection device on every transition between raster and vector modes.
For more details please consult individual commit messages (they are extremely long and detailed).
Test Plan
- Create a rectangular pixel selection
- Draw a line on it with a brush
- Create a rectangular vector selection at a side of the previous one
- Draw a line on it with a brush
- Press Ctrl+Z twice to undo the second selection
Formalities Checklist
-
I confirmed this builds. -
I confirmed Krita ran and the relevant functions work. -
I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!) -
I made sure my commits build individually and have good descriptions as per KDE guidelines. -
I made sure my code conforms to the standards set in the HACKING file. -
I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.