From eba888082a3aa9a23932899b1a457862a40f28b2 Mon Sep 17 00:00:00 2001 From: CJK_mkp <113243675+CJKmkp@users.noreply.github.com> Date: Tue, 10 Jun 2025 18:00:31 +0800 Subject: [PATCH] Revert "try to fix:issue #3" This reverts commit 43beffeadd129e966bcf39f3b83a2cb505292b6d. --- .../MainWindow_cs/MW_FloatingBarIcons.cs | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs b/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs index 83e8c163..61d5c7e4 100644 --- a/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs +++ b/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs @@ -1074,16 +1074,15 @@ namespace Ink_Canvas { var windowHandle = new WindowInteropHelper(this).Handle; var screen = System.Windows.Forms.Screen.FromHandle(windowHandle); double screenWidth = screen.Bounds.Width / dpiScaleX, screenHeight = screen.Bounds.Height / dpiScaleY; - - // 修正:直接使用 WorkingArea 计算工作区高度 - double workingAreaHeight = screen.WorkingArea.Height / dpiScaleY; - + var toolbarHeight = SystemParameters.PrimaryScreenHeight - SystemParameters.FullPrimaryScreenHeight - + SystemParameters.WindowCaptionHeight; pos.X = (screenWidth - ViewboxFloatingBar.ActualWidth * ViewboxFloatingBarScaleTransform.ScaleX) / 2; if (PosXCaculatedWithTaskbarHeight == false) - pos.Y = workingAreaHeight - MarginFromEdge * ViewboxFloatingBarScaleTransform.ScaleY; + pos.Y = screenHeight - MarginFromEdge * ViewboxFloatingBarScaleTransform.ScaleY; else if (PosXCaculatedWithTaskbarHeight == true) - pos.Y = workingAreaHeight - ViewboxFloatingBar.ActualHeight * ViewboxFloatingBarScaleTransform.ScaleY - ViewboxFloatingBarScaleTransform.ScaleY * 3; + pos.Y = screenHeight - ViewboxFloatingBar.ActualHeight * ViewboxFloatingBarScaleTransform.ScaleY - + toolbarHeight - ViewboxFloatingBarScaleTransform.ScaleY * 3; if (MarginFromEdge != -60) { if (BtnPPTSlideShowEnd.Visibility == Visibility.Visible) { @@ -1138,13 +1137,12 @@ namespace Ink_Canvas { var windowHandle = new WindowInteropHelper(this).Handle; var screen = System.Windows.Forms.Screen.FromHandle(windowHandle); double screenWidth = screen.Bounds.Width / dpiScaleX, screenHeight = screen.Bounds.Height / dpiScaleY; - - // 修正:直接使用 WorkingArea 计算工作区高度 - double workingAreaHeight = screen.WorkingArea.Height / dpiScaleY; - + var toolbarHeight = SystemParameters.PrimaryScreenHeight - SystemParameters.FullPrimaryScreenHeight - + SystemParameters.WindowCaptionHeight; pos.X = (screenWidth - ViewboxFloatingBar.ActualWidth * ViewboxFloatingBarScaleTransform.ScaleX) / 2; - pos.Y = workingAreaHeight - ViewboxFloatingBar.ActualHeight * ViewboxFloatingBarScaleTransform.ScaleY - ViewboxFloatingBarScaleTransform.ScaleY * 3; + pos.Y = screenHeight - ViewboxFloatingBar.ActualHeight * ViewboxFloatingBarScaleTransform.ScaleY - + toolbarHeight - ViewboxFloatingBarScaleTransform.ScaleY * 3; if (pointDesktop.X != -1 || pointDesktop.Y != -1) pointDesktop = pos; @@ -1182,13 +1180,11 @@ namespace Ink_Canvas { var windowHandle = new WindowInteropHelper(this).Handle; var screen = System.Windows.Forms.Screen.FromHandle(windowHandle); double screenWidth = screen.Bounds.Width / dpiScaleX, screenHeight = screen.Bounds.Height / dpiScaleY; - - // 修正:直接使用 WorkingArea 计算工作区高度 - double workingAreaHeight = screen.WorkingArea.Height / dpiScaleY; - + var toolbarHeight = SystemParameters.PrimaryScreenHeight - SystemParameters.FullPrimaryScreenHeight - + SystemParameters.WindowCaptionHeight; pos.X = (screenWidth - ViewboxFloatingBar.ActualWidth * ViewboxFloatingBarScaleTransform.ScaleX) / 2; - pos.Y = workingAreaHeight - 55 * ViewboxFloatingBarScaleTransform.ScaleY; + pos.Y = screenHeight - 55 * ViewboxFloatingBarScaleTransform.ScaleY; if (pointPPT.X != -1 || pointPPT.Y != -1) {