diff --git a/Ink Canvas/Windows/ScreenshotSelectorWindow.xaml b/Ink Canvas/Windows/ScreenshotSelectorWindow.xaml
index d82fcbd6..c811439e 100644
--- a/Ink Canvas/Windows/ScreenshotSelectorWindow.xaml
+++ b/Ink Canvas/Windows/ScreenshotSelectorWindow.xaml
@@ -18,12 +18,14 @@
+ Opacity="0.3"
+ IsHitTestVisible="False" />
@@ -43,8 +45,14 @@
+ Fill="#01FFFFFF"
+ Visibility="Collapsed"
+ IsHitTestVisible="True"
+ Panel.ZIndex="1001"
+ MouseLeftButtonDown="SelectionRectangle_MouseLeftButtonDown"
+ MouseLeftButtonUp="SelectionRectangle_MouseLeftButtonUp"
+ MouseMove="SelectionRectangle_MouseMove"
+ Cursor="SizeAll" />
screenBounds.Right) newRect.X = screenBounds.Right - newRect.Width;
+ if (newRect.Bottom > screenBounds.Bottom) newRect.Y = screenBounds.Bottom - newRect.Height;
+
+ _currentSelection = newRect;
+ UpdateSelectionDisplay();
+
+ _lastMousePosition = currentPosition;
+ e.Handled = true;
+
+ // 添加调试信息
+ System.Diagnostics.Debug.WriteLine($"SelectionRectangle moving: delta=({delta.X}, {delta.Y}), newRect=({newRect.X}, {newRect.Y}, {newRect.Width}, {newRect.Height})");
+ }
+ catch (Exception ex)
+ {
+ // 如果出现异常,停止移动
+ System.Diagnostics.Debug.WriteLine($"SelectionRectangle move error: {ex.Message}");
+ _isMoving = false;
+ _activeControlPoint = ControlPointType.None;
+ SelectionRectangle.ReleaseMouseCapture();
+ }
+ }
+
+ private void SelectionRectangle_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+ {
+ if (_isMoving && _activeControlPoint == ControlPointType.Move)
+ {
+ _isMoving = false;
+ _activeControlPoint = ControlPointType.None;
+ SelectionRectangle.ReleaseMouseCapture();
+ e.Handled = true;
+ }
+ }
+
private void ResetSelectionState()
{
// 重置所有选择相关的状态
@@ -724,6 +808,12 @@ namespace Ink_Canvas
ReleaseMouseCapture();
}
+ // 释放选择矩形的鼠标捕获
+ if (SelectionRectangle.IsMouseCaptured)
+ {
+ SelectionRectangle.ReleaseMouseCapture();
+ }
+
// 重置选择区域
_currentSelection = new Rect();
SelectedArea = null;