improve:白板翻页性能

This commit is contained in:
2026-02-22 13:57:56 +08:00
parent 30bc0b03e5
commit 2d51eb73b5
2 changed files with 6 additions and 19 deletions
@@ -163,7 +163,6 @@ namespace Ink_Canvas
/// <remarks> /// <remarks>
/// - 根据参数设置当前提交类型 /// - 根据参数设置当前提交类型
/// - 清除画布上的所有墨迹 /// - 清除画布上的所有墨迹
/// - 执行轻量级内存清理
/// - 恢复当前提交类型为用户输入 /// - 恢复当前提交类型为用户输入
/// </remarks> /// </remarks>
private void ClearStrokes(bool isErasedByCode) private void ClearStrokes(bool isErasedByCode)
@@ -173,23 +172,9 @@ namespace Ink_Canvas
inkCanvas.Strokes.Clear(); inkCanvas.Strokes.Clear();
// 执行内存清理
PerformLightweightMemoryCleanup();
_currentCommitType = CommitReason.UserInput; _currentCommitType = CommitReason.UserInput;
} }
/// <summary>
/// 执行内存清理
/// </summary>
private void PerformLightweightMemoryCleanup()
{
Task.Run(() =>
{
GC.Collect();
});
}
private static HashSet<UIElement> CollectRemovedElementsFromHistory(TimeMachineHistory[] history) private static HashSet<UIElement> CollectRemovedElementsFromHistory(TimeMachineHistory[] history)
{ {
var set = new HashSet<UIElement>(); var set = new HashSet<UIElement>();
+6 -4
View File
@@ -556,10 +556,12 @@ namespace Ink_Canvas
if (arg != "/F") if (arg != "/F")
{ {
var p = new Process(); using (var p = new Process())
p.StartInfo = new ProcessStartInfo("taskkill", arg); {
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; p.StartInfo = new ProcessStartInfo("taskkill", arg);
p.Start(); p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
p.Start();
}
if (arg.Contains("EasiNote")) if (arg.Contains("EasiNote"))
{ {