From 1c8bdcf352e469f14122d2a0537134946809296b Mon Sep 17 00:00:00 2001 From: tayasui rainnya! <156585442+Tayasui-rainnya@users.noreply.github.com> Date: Sun, 22 Feb 2026 14:14:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=A8=E9=80=89=E5=90=8E=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E6=B7=BB=E5=8A=A0=E5=88=B0=E7=99=BD=E6=9D=BF=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=B7=B2=E5=8F=96=E6=B6=88=20(#379)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 调整截图按钮默认行为为选区/白板全屏 * 截图选择器新增添加到白板按钮并支持新建白板页插入 * 修复添加到白板不生效:改为剪贴板复制粘贴插入 * 修复添加到白板截图时序:先截到内存再进白板 * Fix screenshot insert flow honoring add-to-whiteboard option * Refine screenshot selector freehand confirm and blank double-click full select * Fix freehand whiteboard insert alpha transparency * Fix screenshot insert notification text for whiteboard flow * Adjust screenshot selection: right-click/double-click full-select and keep selector on single click * Show unmasked freehand selection area like rectangle mode * Remove freehand cutout mask rendering from screenshot selector * Restore freehand selected-area unmask behavior in selector * fix: always restore window visibility after area screenshot * fix: allow add-to-whiteboard after full-screen selection --- Ink Canvas/MainWindow_cs/MW_Screenshot.cs | 8 +++++--- Ink Canvas/Windows/ScreenshotSelectorWindow.xaml.cs | 11 +++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Ink Canvas/MainWindow_cs/MW_Screenshot.cs b/Ink Canvas/MainWindow_cs/MW_Screenshot.cs index ae7ac7c1..fe5b694f 100644 --- a/Ink Canvas/MainWindow_cs/MW_Screenshot.cs +++ b/Ink Canvas/MainWindow_cs/MW_Screenshot.cs @@ -162,14 +162,13 @@ namespace Ink_Canvas internal async Task SaveAreaScreenShotToDesktop() { + var originalVisibility = Visibility; try { - var originalVisibility = Visibility; Visibility = Visibility.Hidden; await Task.Delay(200); var screenshotResult = await ShowScreenshotSelector(); - Visibility = originalVisibility; if (!screenshotResult.HasValue) { @@ -235,9 +234,12 @@ namespace Ink_Canvas } catch (Exception ex) { - Visibility = Visibility.Visible; ShowNotification($"截图失败: {ex.Message}"); } + finally + { + Visibility = originalVisibility; + } } private async Task AddScreenshotToNewWhiteboardPage(ScreenshotResult screenshotResult) diff --git a/Ink Canvas/Windows/ScreenshotSelectorWindow.xaml.cs b/Ink Canvas/Windows/ScreenshotSelectorWindow.xaml.cs index 5429f0be..2b373bc7 100644 --- a/Ink Canvas/Windows/ScreenshotSelectorWindow.xaml.cs +++ b/Ink Canvas/Windows/ScreenshotSelectorWindow.xaml.cs @@ -1112,8 +1112,19 @@ namespace Ink_Canvas int screenHeight = (int)(_currentSelection.Height * dpiScale); SelectedArea = new DrawingRectangle(screenX, screenY, screenWidth, screenHeight); + } + + if (SelectedArea.HasValue) + { DialogResult = true; } + else + { + HintText.Text = "请先选择截图区域"; + HintTextBorder.Visibility = Visibility.Visible; + return; + } + Close(); }