From 36e47cec43ca89e89bb61317ef4880659f1abac3 Mon Sep 17 00:00:00 2001 From: tayasui rainnya! <156585442+Tayasui-rainnya@users.noreply.github.com> Date: Thu, 9 Apr 2026 13:07:28 +0800 Subject: [PATCH] fix: align ink overlay DPI and ignore include-ink toolbar clicks --- Ink Canvas/MainWindow_cs/MW_ImageInsert.cs | 5 +++-- Ink Canvas/Windows/ScreenshotSelectorWindow.xaml | 3 ++- Ink Canvas/Windows/ScreenshotSelectorWindow.xaml.cs | 4 ++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Ink Canvas/MainWindow_cs/MW_ImageInsert.cs b/Ink Canvas/MainWindow_cs/MW_ImageInsert.cs index 69d58d29..bb0a7326 100644 --- a/Ink Canvas/MainWindow_cs/MW_ImageInsert.cs +++ b/Ink Canvas/MainWindow_cs/MW_ImageInsert.cs @@ -374,11 +374,12 @@ namespace Ink_Canvas dc.DrawRectangle(visualBrush, null, inkRectDip); } + var dpi = 96.0 * dpiScale; var rtb = new RenderTargetBitmap( Math.Max(1, virtualScreen.Width), Math.Max(1, virtualScreen.Height), - 96, - 96, + dpi, + dpi, PixelFormats.Pbgra32); rtb.Render(drawingVisual); rtb.Freeze(); diff --git a/Ink Canvas/Windows/ScreenshotSelectorWindow.xaml b/Ink Canvas/Windows/ScreenshotSelectorWindow.xaml index 86e0dfef..d2654a16 100644 --- a/Ink Canvas/Windows/ScreenshotSelectorWindow.xaml +++ b/Ink Canvas/Windows/ScreenshotSelectorWindow.xaml @@ -155,7 +155,8 @@ Foreground="White" Checked="IncludeInkCheckBox_Checked" Unchecked="IncludeInkCheckBox_Unchecked" /> - diff --git a/Ink Canvas/Windows/ScreenshotSelectorWindow.xaml.cs b/Ink Canvas/Windows/ScreenshotSelectorWindow.xaml.cs index a9ca011b..a0b056d1 100644 --- a/Ink Canvas/Windows/ScreenshotSelectorWindow.xaml.cs +++ b/Ink Canvas/Windows/ScreenshotSelectorWindow.xaml.cs @@ -628,10 +628,12 @@ namespace Ink_Canvas if (hitElement != null && ( hitElement is Ellipse || hitElement is System.Windows.Controls.Button || + hitElement is System.Windows.Controls.CheckBox || hitElement is Border || hitElement is TextBlock || hitElement is StackPanel || hitElement is Separator || + hitElement.Name == "ToolbarDividerRectangle" || hitElement.Name == "SizeInfoBorder" || hitElement.Name == "HintText" || hitElement.Name == "AdjustModeHint" || @@ -719,10 +721,12 @@ namespace Ink_Canvas if (hitElement != null && ( hitElement is Ellipse || hitElement is System.Windows.Controls.Button || + hitElement is System.Windows.Controls.CheckBox || hitElement is Border || hitElement is TextBlock || hitElement is StackPanel || hitElement is Separator || + hitElement.Name == "ToolbarDividerRectangle" || hitElement.Name == "SizeInfoBorder" || hitElement.Name == "HintText" || hitElement.Name == "AdjustModeHint"))