Okay so there are 2 different problems with undo and redo. First SelectedShapeIndex is not correctly copied while undo/redo which makes undo/redo not working sometimes. Second problem is if you are using undo/redo by clicking on toolbar undo/redo works correctly but not show on screen immediately and you have to move your cursor to view to see that change on screen. (Funny thing if you are using ctrl+z, ctrl+shift+z istead of clicking in toolbar problem 2 does not appear).
I figured out how to fix first problem, you have to just copy SelectedShapeIndex manually in Swap function in ShapesModifyHistoryItem class.
But currently I don't know how to force view to refresh immediately.
Right now I don't have time so I will come back here in a few days and I will try to fix second problem also.
Okay so there are 2 different problems with undo and redo. First SelectedShapeIndex is not correctly copied while undo/redo which makes undo/redo not working sometimes. Second problem is if you are using undo/redo by clicking on toolbar undo/redo works correctly but not show on screen immediately and you have to move your cursor to view to see that change on screen. (Funny thing if you are using ctrl+z, ctrl+shift+z istead of clicking in toolbar problem 2 does not appear).
I figured out how to fix first problem, you have to just copy SelectedShapeIndex manually in Swap function in ShapesModifyHis toryItem class.
But currently I don't know how to force view to refresh immediately.
Right now I don't have time so I will come back here in a few days and I will try to fix second problem also.