|
@@ -1,3 +1,4 @@
|
|
|
+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:flutter/material.dart';
|
|
@@ -15,6 +16,7 @@ class AnnotationLabelDragTargetPanel extends StatefulWidget {
|
|
|
|
|
|
class _PanelState extends State<AnnotationLabelDragTargetPanel> {
|
|
|
late final application = Get.find<IApplication>();
|
|
|
+ final mouseState = Get.find<IMouseState>();
|
|
|
|
|
|
@override
|
|
|
void initState() {
|
|
@@ -28,11 +30,24 @@ class _PanelState extends State<AnnotationLabelDragTargetPanel> {
|
|
|
// color: Colors.green,
|
|
|
child: DragTarget<String>(
|
|
|
builder: (context, candidateData, rejectedData) {
|
|
|
- return Container(
|
|
|
- child: Stack(
|
|
|
- children: const [
|
|
|
- PositionedCursor(),
|
|
|
- ],
|
|
|
+ return GestureDetector(
|
|
|
+ onPanDown: (details) {
|
|
|
+ application.createPointInfo(
|
|
|
+ details.localPosition,
|
|
|
+ PointInfoType.mouseDown,
|
|
|
+ );
|
|
|
+ application.switchAnnotation(AnnotationType.input);
|
|
|
+ },
|
|
|
+ child: MouseRegion(
|
|
|
+ cursor: SystemMouseCursors.none,
|
|
|
+ onHover: (event) {
|
|
|
+ mouseState.mousePosition = event.localPosition;
|
|
|
+ },
|
|
|
+ child: Stack(
|
|
|
+ children: const [
|
|
|
+ PositionedCursor(),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
);
|
|
|
},
|
|
@@ -52,6 +67,7 @@ class _PanelState extends State<AnnotationLabelDragTargetPanel> {
|
|
|
PointInfoType type,
|
|
|
) {
|
|
|
final localOffset = _findLocalPosition(context, offset);
|
|
|
+ mouseState.mousePosition = localOffset;
|
|
|
application.createPointInfo(localOffset, type);
|
|
|
}
|
|
|
|