improve:自动更新
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user