diff --git a/.gitignore b/.gitignore index 426d76d..84c2f88 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +.vscode + ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## diff --git a/MapTP.App/InspectorWindow.xaml.cs b/MapTP.App/InspectorWindow.xaml.cs index 9edb28a..e195913 100644 --- a/MapTP.App/InspectorWindow.xaml.cs +++ b/MapTP.App/InspectorWindow.xaml.cs @@ -31,23 +31,23 @@ public partial class InspectorWindow : Window public _TriggerEvent MainWindow_Start; public _TriggerEvent MainWindow_Turtle; - private readonly int X,Y, eX, eY; + private readonly int X, Y, eX, eY; public InspectorWindow(int X, int Y, int eX, int eY) { InitializeComponent(); - this.X= X; - this.Y= Y; - this.eX= eX; - this.eY= eY; + this.X = X; + this.Y = Y; + this.eX = eX; + this.eY = eY; } protected override void OnSourceInitialized(EventArgs e) { base.OnSourceInitialized(e); - this.LocationChanged+= OnTransformChanged; + this.LocationChanged += OnTransformChanged; this.SizeChanged += OnTransformChanged; - this.DpiRatio=ScreenManager.GetDpiRatio(this); + this.DpiRatio = ScreenManager.GetDpiRatio(this); this.Loaded += OnLoaded; } @@ -67,12 +67,14 @@ private void OnTransformChanged(object sender, EventArgs e) var y = (int)(this.Top * DpiRatio); var ex = (int)((this.Left + this.width) * DpiRatio); var ey = (int)((this.Top + this.height) * DpiRatio); - if (x >= 0 && y >= 0 && ex <= ScreenManager.GetScreenWidth() && ey <= ScreenManager.GetScreenHeight()) { - TitleBar.Background = new SolidColorBrush(Color.FromArgb(0x33,0xff,0xff,0xff)); - SendScreenArea(x, y, ex, ey); + if (x >= 0 && y >= 0 && ex <= ScreenManager.GetScreenWidth() && ey <= ScreenManager.GetScreenHeight()) + { + TitleBar.Background = new SolidColorBrush(Color.FromArgb(0x33, 0xff, 0xff, 0xff)); + SendScreenArea(x, y, ex, ey); } - else { - TitleBar.Background = new SolidColorBrush(Color.FromArgb(0x33,0xff,0x00,0x00)); + else + { + TitleBar.Background = new SolidColorBrush(Color.FromArgb(0x33, 0xff, 0x00, 0x00)); } } @@ -102,8 +104,8 @@ private void StartButtonClick(object sender, RoutedEventArgs e) { MainWindow_Start(sender, e); } - this.StopButton.Visibility=Visibility.Visible; - this.StartButton.Visibility=Visibility.Collapsed; + this.StopButton.Visibility = Visibility.Visible; + this.StartButton.Visibility = Visibility.Collapsed; } private void StopButtonClick(object sender, RoutedEventArgs e) @@ -112,8 +114,8 @@ private void StopButtonClick(object sender, RoutedEventArgs e) { MainWindow_Stop(sender, e); } - this.StopButton.Visibility=Visibility.Collapsed; - this.StartButton.Visibility=Visibility.Visible; + this.StopButton.Visibility = Visibility.Collapsed; + this.StartButton.Visibility = Visibility.Visible; } } diff --git a/MapTP.App/MainWindow.xaml b/MapTP.App/MainWindow.xaml index c4112aa..36e9cf7 100644 --- a/MapTP.App/MainWindow.xaml +++ b/MapTP.App/MainWindow.xaml @@ -101,6 +101,7 @@ + @@ -114,6 +115,22 @@ + + + + + + + + + + + + + + +