|
@@ -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 {
|