ソースを参照

修正未开始的组合测量项失活后未删除记录 #0011874

gavin.chen 2 年 前
コミット
75b117d729
1 ファイル変更8 行追加1 行削除
  1. 8 1
      lib/process/workspace/application.dart

+ 8 - 1
lib/process/workspace/application.dart

@@ -18,6 +18,7 @@ import 'package:fis_measure/process/annotations/arrow_annotation.dart';
 import 'package:fis_measure/process/annotations/input_annotation.dart';
 import 'package:fis_measure/process/annotations/label_annotation.dart';
 import 'package:fis_measure/process/items/factory.dart';
+import 'package:fis_measure/process/items/top_item.dart';
 import 'package:flutter/foundation.dart';
 import 'package:flutter/painting.dart';
 import 'package:vid/us/vid_us_image.dart';
@@ -416,7 +417,13 @@ class Application implements IApplication {
   void _handleBeforeSwitchItem() {
     if (activeMeasureItem == null) return;
     final item = activeMeasureItem!;
-    if (item.feature != null) {
+    if (item is TopMeasureItem) {
+      bool isAllEmpty =
+          item.childItems.every((e) => e.measuredFeatures.isEmpty);
+      if (isAllEmpty) {
+        _recorder.undoOnce();
+      }
+    } else if (item.feature != null) {
       if (item.finishAfterUnactive) {
         item.finishOnce();
       } else {