From 11bf8cffb2ce7c92b928b4ccaae229d1bbc2e140 Mon Sep 17 00:00:00 2001 From: CJK_mkp <113243675+CJKmkp@users.noreply.github.com> Date: Sat, 8 Nov 2025 19:55:10 +0800 Subject: [PATCH] =?UTF-8?q?improve:PPT=E5=A2=A8=E8=BF=B9=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ink Canvas/MainWindow_cs/MW_PPT.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Ink Canvas/MainWindow_cs/MW_PPT.cs b/Ink Canvas/MainWindow_cs/MW_PPT.cs index 48435399..d542b616 100644 --- a/Ink Canvas/MainWindow_cs/MW_PPT.cs +++ b/Ink Canvas/MainWindow_cs/MW_PPT.cs @@ -1145,6 +1145,9 @@ namespace Ink_Canvas { try { + ClearStrokes(true); + timeMachine.ClearStrokeHistory(); + StrokeCollection strokes = null; if (Settings.PowerPointSettings.IsSupportWPS) { @@ -1155,9 +1158,8 @@ namespace Ink_Canvas strokes = _multiPPTInkManager?.LoadSlideStrokes(slideIndex); } - if (strokes != null) + if (strokes != null && strokes.Count > 0) { - inkCanvas.Strokes.Clear(); inkCanvas.Strokes.Add(strokes); } } @@ -1288,7 +1290,6 @@ namespace Ink_Canvas // 获取当前页面索引 var currentSlideIndex = _pptManager?.GetCurrentSlideNumber() ?? 0; - // 验证页面索引的有效性 if (newSlideIndex <= 0) { @@ -1321,10 +1322,9 @@ namespace Ink_Canvas } } } - else if (inkCanvas.Strokes.Count > 0 && currentSlideIndex <= 0) - { - } + ClearStrokes(true); + timeMachine.ClearStrokeHistory(); StrokeCollection newStrokes = null; if (Settings.PowerPointSettings.IsSupportWPS) { @@ -1334,9 +1334,9 @@ namespace Ink_Canvas { newStrokes = _multiPPTInkManager?.SwitchToSlide(newSlideIndex, null); } - if (newStrokes != null) + + if (newStrokes != null && newStrokes.Count > 0) { - inkCanvas.Strokes.Clear(); inkCanvas.Strokes.Add(newStrokes); }