diff --git a/XplorePlane/Assets/Icons/polygon.png b/XplorePlane/Assets/Icons/polygon.png new file mode 100644 index 0000000..a9325a0 Binary files /dev/null and b/XplorePlane/Assets/Icons/polygon.png differ diff --git a/XplorePlane/ViewModels/ImageProcessing/BgaDetectionViewModel.cs b/XplorePlane/ViewModels/ImageProcessing/BgaDetectionViewModel.cs index 914204a..2db8a1e 100644 --- a/XplorePlane/ViewModels/ImageProcessing/BgaDetectionViewModel.cs +++ b/XplorePlane/ViewModels/ImageProcessing/BgaDetectionViewModel.cs @@ -113,11 +113,15 @@ namespace XplorePlane.ViewModels.ImageProcessing _canvas.ROIItems.Add(_roiShape); _canvas.SelectedROI = _roiShape; - // 手动注册 CollectionChanged + // 手动注册 CollectionChanged(仅在添加/删除顶点时更新 Adorner,拖拽不触发) _roiShape.Points.CollectionChanged += (s, e) => { - _canvas.SelectedROI = null; - _canvas.SelectedROI = _roiShape; + if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add || + e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove) + { + _canvas.SelectedROI = null; + _canvas.SelectedROI = _roiShape; + } }; // 禁用右键菜单(参考点点距方式) diff --git a/XplorePlane/Views/ImageProcessing/BgaDetectionPanel.xaml b/XplorePlane/Views/ImageProcessing/BgaDetectionPanel.xaml index c56120a..a2b6593 100644 --- a/XplorePlane/Views/ImageProcessing/BgaDetectionPanel.xaml +++ b/XplorePlane/Views/ImageProcessing/BgaDetectionPanel.xaml @@ -14,7 +14,39 @@ - + + + + + + diff --git a/XplorePlane/Views/Main/ViewportPanelView.xaml.cs b/XplorePlane/Views/Main/ViewportPanelView.xaml.cs index 5a16883..c8ced63 100644 --- a/XplorePlane/Views/Main/ViewportPanelView.xaml.cs +++ b/XplorePlane/Views/Main/ViewportPanelView.xaml.cs @@ -137,6 +137,8 @@ namespace XplorePlane.Views private void ClearAllMeasurements_Click(object sender, RoutedEventArgs e) { RoiCanvas.ClearMeasurements(); + RoiCanvas.ROIItems?.Clear(); + RoiCanvas.SelectedROI = null; if (DataContext is ViewportPanelViewModel vm) vm.ResetMeasurementState(); SetStatus("已清除所有测量");