From 1489fb645e50d4c49c7a9cbed9b7bb2aba3278f2 Mon Sep 17 00:00:00 2001 From: CJKmkp <2564608840@qq.com> Date: Wed, 13 Aug 2025 12:11:44 +0800 Subject: [PATCH] =?UTF-8?q?add:=E6=A9=A1=E7=9A=AE=E5=AD=90=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E4=B8=AD=E7=9A=84=E6=B8=85=E7=A9=BA=E6=8C=89=E9=92=AE?= =?UTF-8?q?=EF=BC=8C=E6=9B=B4=E7=AC=A6=E5=90=88=E6=93=8D=E4=BD=9C=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ink Canvas/MainWindow.xaml | 38 ++++++++++++++++++- .../MainWindow_cs/MW_FloatingBarIcons.cs | 24 +++++++----- 2 files changed, 52 insertions(+), 10 deletions(-) diff --git a/Ink Canvas/MainWindow.xaml b/Ink Canvas/MainWindow.xaml index 2f57efb8..0f56d809 100644 --- a/Ink Canvas/MainWindow.xaml +++ b/Ink Canvas/MainWindow.xaml @@ -8094,7 +8094,7 @@ + diff --git a/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs b/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs index a4e49455..39886fda 100644 --- a/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs +++ b/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs @@ -755,6 +755,16 @@ namespace Ink_Canvas #endregion + /// + /// 面积擦子面板的清空墨迹按钮事件处理 + /// + /// sender + /// RoutedEventArgs + private void EraserPanelSymbolIconDelete_MouseUp(object sender, RoutedEventArgs e) + { + SymbolIconDelete_MouseUp(null, null); + } + #region 主要的工具按鈕事件 /// @@ -2813,11 +2823,7 @@ namespace Ink_Canvas // 获取高光的实际宽度 double actualHighlightWidth = FloatingbarSelectionBG.ActualWidth > 0 ? FloatingbarSelectionBG.ActualWidth : highlightWidth; - // 计算位置偏移,考虑Canvas和StackPanel的Margin差异 - // Canvas: Margin="2,0,2,0", StackPanel: Margin="2,0" - // 所以Canvas相对于StackPanel的偏移是:Canvas.Left(2) - StackPanel.Left(2) = 0 - // 但是高光元素本身有Margin="0,-2,0,-2",需要补偿这个偏移 - double marginOffset = 0; // Canvas和StackPanel的Margin已经对齐 + double marginOffset = 0; // 快捷调色盘的Margin:Margin="4,0,4,0",所以总宽度需要加上8像素 double quickColorPaletteTotalWidth = isQuickColorPaletteVisible ? quickColorPaletteWidth + 8 : 0; @@ -2893,10 +2899,10 @@ namespace Ink_Canvas // 详细的调试信息 string debugInfo = $"设置高光位置: {mode} -> {position:F2}, " + - $"高光宽度: {actualHighlightWidth:F2}, " + - $"快捷调色盘: {quickColorPaletteMode}, 宽度: {quickColorPaletteWidth:F2}, 总宽度: {quickColorPaletteTotalWidth:F2}, " + - $"按钮宽度: cursor={cursorWidth:F2}, pen={penWidth:F2}, delete={deleteWidth:F2}, " + - $"eraser={eraserWidth:F2}, eraserByStrokes={eraserByStrokesWidth:F2}, select={selectWidth:F2}"; + $"高光宽度: {actualHighlightWidth:F2}, " + + $"快捷调色盘: {quickColorPaletteMode}, 宽度: {quickColorPaletteWidth:F2}, 总宽度: {quickColorPaletteTotalWidth:F2}, " + + $"按钮宽度: cursor={cursorWidth:F2}, pen={penWidth:F2}, delete={deleteWidth:F2}, " + + $"eraser={eraserWidth:F2}, eraserByStrokes={eraserByStrokesWidth:F2}, select={selectWidth:F2}"; LogHelper.WriteLogToFile(debugInfo, LogHelper.LogType.Trace); }