|
@@ -1,7 +1,9 @@
|
|
|
// ignore_for_file: constant_identifier_names
|
|
|
|
|
|
+import 'package:fis_measure/interfaces/enums/annotation.dart';
|
|
|
import 'package:fis_measure/interfaces/process/workspace/application.dart';
|
|
|
import 'package:fis_measure/interfaces/process/workspace/point_info.dart';
|
|
|
+import 'package:fis_measure/process/annotations/input_annotation.dart';
|
|
|
import 'package:fis_measure/values/colors.dart';
|
|
|
import 'package:fis_measure/view/gesture/mouse_gesture.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
@@ -29,18 +31,18 @@ class _PanelState extends State<AnnotationInputPositionPanel> {
|
|
|
return GestureDetector(
|
|
|
onPanDown: (details) {
|
|
|
setState(() {
|
|
|
- position = details.localPosition;
|
|
|
+ position = details.localPosition -
|
|
|
+ const Offset(
|
|
|
+ _InputWidget.C_MIN_WIDTH / 2,
|
|
|
+ _InputWidget.C_MAX_HEIGHT / 2,
|
|
|
+ );
|
|
|
application.createPointInfo(position!, PointInfoType.mouseDown);
|
|
|
});
|
|
|
},
|
|
|
child: MouseRegion(
|
|
|
cursor: SystemMouseCursors.none,
|
|
|
onHover: (event) {
|
|
|
- mouseState.mousePosition = event.localPosition +
|
|
|
- const Offset(
|
|
|
- _InputWidget.C_MIN_WIDTH / 2,
|
|
|
- _InputWidget.C_MAX_HEIGHT / 2,
|
|
|
- );
|
|
|
+ mouseState.mousePosition = event.localPosition;
|
|
|
},
|
|
|
onEnter: (e) {
|
|
|
setState(() {
|
|
@@ -48,7 +50,12 @@ class _PanelState extends State<AnnotationInputPositionPanel> {
|
|
|
});
|
|
|
},
|
|
|
onExit: (e) {
|
|
|
+ if (application.activeAnnotationItem != null &&
|
|
|
+ application.activeAnnotationItem is InputAnnotation) {
|
|
|
+ application.switchAnnotation(AnnotationType.label);
|
|
|
+ }
|
|
|
setState(() {
|
|
|
+ position = null;
|
|
|
displayType = CursorDisplayType.none;
|
|
|
});
|
|
|
},
|