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). BUG:411394
Loading