Skip to content

Commit

Permalink
Merge pull request #15 from lovewanli/master
Browse files Browse the repository at this point in the history
更新截图工具ScreenCut
  • Loading branch information
yanjinhuagood authored Oct 31, 2022
2 parents 35d8b4e + 0d4e6e7 commit 021d7e5
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions src/WPFDevelopers.Shared/Controls/ScreenCut/ScreenCut.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ public override void OnApplyTemplate()

controlTemplate = (ControlTemplate)FindResource("PART_DrawArrow");
}
protected override void OnPreviewMouseRightButtonDown(MouseButtonEventArgs e)
{
Close();
}

private void _radioButtonInk_Click(object sender, RoutedEventArgs e)
{
Expand Down Expand Up @@ -256,13 +260,16 @@ private void ResoreRadioButton()

private void _border_SizeChanged(object sender, SizeChangedEventArgs e)
{
var left = Canvas.GetLeft(_border);
var top = Canvas.GetTop(_border);
var beignPoint = new Point(left, top);
var endPoint = new Point(left + _border.ActualWidth, top + _border.ActualHeight);
rect = new Rect(beignPoint, endPoint);
pointStart = beignPoint;
MoveAllRectangle(endPoint);
if (isMouseUp)
{
var left = Canvas.GetLeft(_border);
var top = Canvas.GetTop(_border);
var beignPoint = new Point(left, top);
var endPoint = new Point(left + _border.ActualWidth, top + _border.ActualHeight);
rect = new Rect(beignPoint, endPoint);
pointStart = beignPoint;
MoveAllRectangle(endPoint);
}
EditBarPosition();
}

Expand Down Expand Up @@ -823,6 +830,10 @@ protected override void OnPreviewMouseLeftButtonUp(MouseButtonEventArgs e)
{
if (e.Source is ToggleButton)
return;
if (pointStart == pointEnd)
{
return;
}
var fElement = e.Source as FrameworkElement;
if (fElement != null && fElement.Tag == null)
SelectElement();
Expand Down

0 comments on commit 021d7e5

Please sign in to comment.