improve:pdf插入

This commit is contained in:
2026-04-05 20:37:48 +08:00
parent 24bc2cf138
commit fea6576dfb
+8 -1
View File
@@ -226,6 +226,7 @@ namespace Ink_Canvas
if (TimeMachineHistories[targetIndex] == null) if (TimeMachineHistories[targetIndex] == null)
{ {
timeMachine.ClearStrokeHistory(); timeMachine.ClearStrokeHistory();
SyncPdfPageSidebarWithCanvas();
return; return;
} }
@@ -282,7 +283,11 @@ namespace Ink_Canvas
/// </summary> /// </summary>
private void ProcessElementsAfterRestore(List<UIElement> elements) private void ProcessElementsAfterRestore(List<UIElement> elements)
{ {
if (elements == null || elements.Count == 0) return; if (elements == null || elements.Count == 0)
{
SyncPdfPageSidebarWithCanvas();
return;
}
// 使用低优先级异步处理,让 UI 先响应,图片位置和事件绑定稍后完成 // 使用低优先级异步处理,让 UI 先响应,图片位置和事件绑定稍后完成
Dispatcher.BeginInvoke(DispatcherPriority.Loaded, new Action(() => Dispatcher.BeginInvoke(DispatcherPriority.Loaded, new Action(() =>
@@ -322,6 +327,8 @@ namespace Ink_Canvas
BindElementEvents(pdf); BindElementEvents(pdf);
} }
} }
SyncPdfPageSidebarWithCanvas();
})); }));
} }