improve:自动更新

This commit is contained in:
2026-02-12 17:22:47 +08:00
parent 200317a0f5
commit 376790330d
7 changed files with 99 additions and 12 deletions
+10
View File
@@ -92,6 +92,11 @@ namespace Ink_Canvas.Helpers
public TimeMachineHistory Undo()
{
if (_currentIndex < 0 || _currentIndex >= _currentStrokeHistory.Count)
{
return null;
}
var item = _currentStrokeHistory[_currentIndex];
item.StrokeHasBeenCleared = !item.StrokeHasBeenCleared;
_currentIndex--;
@@ -102,6 +107,11 @@ namespace Ink_Canvas.Helpers
public TimeMachineHistory Redo()
{
if (_currentStrokeHistory.Count == 0 || _currentIndex >= _currentStrokeHistory.Count - 1)
{
return null;
}
var item = _currentStrokeHistory[++_currentIndex];
item.StrokeHasBeenCleared = !item.StrokeHasBeenCleared;
NotifyUndoRedoState();