improve:白板翻页性能

This commit is contained in:
2026-02-22 12:42:47 +08:00
parent 705f4fd155
commit 3d0a960337
2 changed files with 11 additions and 5 deletions
+10 -2
View File
@@ -512,11 +512,19 @@ namespace Ink_Canvas
if (pageIndex == CurrentWhiteboardIndex)
{
ClearStrokes(true);
if (CurrentWhiteboardIndex != WhiteboardTotalCount)
for (var i = CurrentWhiteboardIndex; i <= WhiteboardTotalCount; i++)
var oldTotal = WhiteboardTotalCount;
if (CurrentWhiteboardIndex != oldTotal)
{
for (var i = CurrentWhiteboardIndex; i < oldTotal; i++)
TimeMachineHistories[i] = TimeMachineHistories[i + 1];
}
else
{
CurrentWhiteboardIndex--;
}
TimeMachineHistories[oldTotal] = null;
WhiteboardTotalCount--;
RestoreStrokes();
}