[EraseByPoint] 修改添加和移除Stroke的顺序以保证在Stroke复杂时的撤销/重做行为正常

This commit is contained in:
Raspberry-Monster 2023-04-27 22:20:58 +08:00
parent 7b4041a216
commit 080b8499f2
No known key found for this signature in database
GPG Key ID: 9A0D725BB122D507

View File

@ -3322,13 +3322,6 @@ namespace Ink_Canvas
}
else
{
if (item.CurrentStroke != null)
{
foreach (var currentStroke in item.CurrentStroke)
{
if (inkCanvas.Strokes.Contains(currentStroke)) inkCanvas.Strokes.Remove(currentStroke);
}
}
if (item.ReplacedStroke != null)
{
foreach (var replacedStroke in item.ReplacedStroke)
@ -3336,6 +3329,13 @@ namespace Ink_Canvas
if (!inkCanvas.Strokes.Contains(replacedStroke)) inkCanvas.Strokes.Add(replacedStroke);
}
}
if (item.CurrentStroke != null)
{
foreach (var currentStroke in item.CurrentStroke)
{
if (inkCanvas.Strokes.Contains(currentStroke)) inkCanvas.Strokes.Remove(currentStroke);
}
}
}
}
IsCommitingByCode = false;
@ -3417,13 +3417,6 @@ namespace Ink_Canvas
}
else
{
if (item.CurrentStroke != null)
{
foreach (var currentStroke in item.CurrentStroke)
{
if (inkCanvas.Strokes.Contains(currentStroke)) inkCanvas.Strokes.Remove(currentStroke);
}
}
if (item.ReplacedStroke != null)
{
foreach (var replacedStroke in item.ReplacedStroke)
@ -3431,6 +3424,13 @@ namespace Ink_Canvas
if (!inkCanvas.Strokes.Contains(replacedStroke)) inkCanvas.Strokes.Add(replacedStroke);
}
}
if (item.CurrentStroke != null)
{
foreach (var currentStroke in item.CurrentStroke)
{
if (inkCanvas.Strokes.Contains(currentStroke)) inkCanvas.Strokes.Remove(currentStroke);
}
}
}
}
IsCommitingByCode = false;