[BugFix] 修复部分情况下无法正确保存EraseByPoint记录的Bug

This commit is contained in:
Raspberry-Monster 2023-05-23 20:41:02 +08:00
parent 0922a15e37
commit 4fde34ac20
No known key found for this signature in database
GPG Key ID: 9A0D725BB122D507

View File

@ -356,16 +356,13 @@ namespace Ink_Canvas
timeMachine.CommitStrokeRotateHistory(e.Removed, e.Added);
return;
}
if (e.Added.Count != 0 && e.Removed.Count != 0)
if ((e.Added.Count != 0 || e.Removed.Count != 0) && IsEraseByPoint)
{
if (IsEraseByPoint)
{
if (AddedStroke == null) AddedStroke = new StrokeCollection();
if (ReplacedStroke == null) ReplacedStroke = new StrokeCollection();
AddedStroke.Add(e.Added);
ReplacedStroke.Add(e.Removed);
return;
}
if (AddedStroke == null) AddedStroke = new StrokeCollection();
if (ReplacedStroke == null) ReplacedStroke = new StrokeCollection();
AddedStroke.Add(e.Added);
ReplacedStroke.Add(e.Removed);
return;
}
if (e.Added.Count != 0)
{
@ -5302,7 +5299,7 @@ namespace Ink_Canvas
}
else
{
collection = new StrokeCollection () { lastTempStroke };
collection = new StrokeCollection() { lastTempStroke };
}
timeMachine.CommitStrokeUserInputHistory(collection);
}