no message
This commit is contained in:
parent
a13cab2c96
commit
adc07a9346
|
|
@ -281,7 +281,6 @@ class PictureOverviewState extends ConsumerState<PictureOverview> with CommonMix
|
||||||
double containerWidth = constraints.maxWidth;
|
double containerWidth = constraints.maxWidth;
|
||||||
double containerHeight = constraints.maxHeight;
|
double containerHeight = constraints.maxHeight;
|
||||||
|
|
||||||
print('LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL');
|
|
||||||
return $LocalAndNetworkSwitch(
|
return $LocalAndNetworkSwitch(
|
||||||
zoomGlobalKey: zoomGlobalKey,
|
zoomGlobalKey: zoomGlobalKey,
|
||||||
containerWidth: containerWidth,
|
containerWidth: containerWidth,
|
||||||
|
|
@ -300,7 +299,6 @@ class PictureOverviewState extends ConsumerState<PictureOverview> with CommonMix
|
||||||
print('更新需要上传的文件');
|
print('更新需要上传的文件');
|
||||||
},
|
},
|
||||||
imageBuilder: (imageBuilderContext, imageProvider) {
|
imageBuilder: (imageBuilderContext, imageProvider) {
|
||||||
print('PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP');
|
|
||||||
Image imageWidget = Image(image: imageProvider, fit: BoxFit.fitWidth);
|
Image imageWidget = Image(image: imageProvider, fit: BoxFit.fitWidth);
|
||||||
if (imagInfoModel == null || (imagInfoModel?.boxHeight != containerHeight || imagInfoModel?.boxWidth != containerWidth)) {
|
if (imagInfoModel == null || (imagInfoModel?.boxHeight != containerHeight || imagInfoModel?.boxWidth != containerWidth)) {
|
||||||
if (_imageStreamListener != null) _imageStream?.removeListener(_imageStreamListener!);
|
if (_imageStreamListener != null) _imageStream?.removeListener(_imageStreamListener!);
|
||||||
|
|
@ -313,7 +311,6 @@ class PictureOverviewState extends ConsumerState<PictureOverview> with CommonMix
|
||||||
height: info.image.height.toDouble(),
|
height: info.image.height.toDouble(),
|
||||||
width: info.image.width.toDouble(),
|
width: info.image.width.toDouble(),
|
||||||
);
|
);
|
||||||
printJson(imagInfoModel!.toJson());
|
|
||||||
Future.delayed(Duration.zero, () {
|
Future.delayed(Duration.zero, () {
|
||||||
ref.read(zoomHeightProvider.notifier).setState(imagInfoModel?.scaleHeight ?? 0.0);
|
ref.read(zoomHeightProvider.notifier).setState(imagInfoModel?.scaleHeight ?? 0.0);
|
||||||
});
|
});
|
||||||
|
|
@ -339,35 +336,21 @@ class PictureOverviewState extends ConsumerState<PictureOverview> with CommonMix
|
||||||
globalPosition = details.localPosition;
|
globalPosition = details.localPosition;
|
||||||
Offset localPosition = globalPosition!;
|
Offset localPosition = globalPosition!;
|
||||||
|
|
||||||
print('绝对位置:X:${details.position.dx}; Y:${details.position.dy}');
|
if (imagInfoModel != null &&
|
||||||
print('相对位置:X:${globalPosition!.dx}; Y:${globalPosition!.dy}');
|
(localPosition.dy < imagInfoModel!.imageHeightOffsetStart! || localPosition.dy > imagInfoModel!.imageHeightOffsetend!)) {
|
||||||
|
// 笔迹画出图片区域 直接断笔
|
||||||
// if (imagInfoModel != null &&
|
var dataVal = ref.read(drawMarkingProvider).data;
|
||||||
// (localPosition.dy < imagInfoModel!.imageHeightOffsetStart! || localPosition.dy > imagInfoModel!.imageHeightOffsetend!)) {
|
if (dataVal.length - 1 > -1 && dataVal[dataVal.length - 1].data != null) {
|
||||||
// // 笔迹画出图片区域 直接断笔
|
var newVal = ref.read(drawMarkingProvider).data..add(GestureRecording(eraser: graffitiSwitch.openEraser));
|
||||||
// var dataVal = ref.read(drawMarkingProvider).data;
|
var newVal1 = ref.read(drawMarkingProvider).offsets..add(null);
|
||||||
// if (dataVal.length - 1 > -1 && dataVal[dataVal.length - 1].data != null) {
|
ref.read(drawMarkingProvider.notifier).setState(DrawMarkingVal(newVal, newVal1));
|
||||||
// var newVal = ref.read(drawMarkingProvider).data..add(GestureRecording(eraser: graffitiSwitch.openEraser));
|
}
|
||||||
// var newVal1 = ref.read(drawMarkingProvider).offsets..add(null);
|
illegalArea = true;
|
||||||
// ref.read(drawMarkingProvider.notifier).setState(DrawMarkingVal(newVal, newVal1));
|
return;
|
||||||
// }
|
|
||||||
// illegalArea = true;
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// illegalArea = false;
|
|
||||||
// Offset localPosition = (context.findRenderObject() as RenderBox).globalToLocal(details.localPosition);
|
|
||||||
// if (widget.graffitiSwitch.openBrush || widget.graffitiSwitch.openEraser) {
|
|
||||||
|
|
||||||
// if (imagInfoModel?.scaleHeight != null) {
|
|
||||||
// localPosition = Offset(localPosition.dx, localPosition.dy - imagInfoModel!.scaleHeight!);
|
|
||||||
// }
|
|
||||||
var zoomState = _zoomKey.currentState;
|
|
||||||
if (zoomState != null) {
|
|
||||||
print(zoomState);
|
|
||||||
}
|
}
|
||||||
|
illegalArea = false;
|
||||||
|
|
||||||
double remainingHeight = imagInfoModel!.imageHeightOffsetStart!; // 剩余高度
|
double remainingHeight = imagInfoModel!.imageHeightOffsetStart!; // 剩余高度
|
||||||
var _scaleY = (zoomInfo?.scale ?? 1);
|
|
||||||
if (remainingHeight > 1) {
|
if (remainingHeight > 1) {
|
||||||
localPosition = Offset(localPosition.dx, localPosition.dy - remainingHeight);
|
localPosition = Offset(localPosition.dx, localPosition.dy - remainingHeight);
|
||||||
|
|
||||||
|
|
@ -386,42 +369,22 @@ class PictureOverviewState extends ConsumerState<PictureOverview> with CommonMix
|
||||||
localPosition = Offset(localPosition.dx / imagInfoModel!.zoom, localPosition.dy / imagInfoModel!.zoom);
|
localPosition = Offset(localPosition.dx / imagInfoModel!.zoom, localPosition.dy / imagInfoModel!.zoom);
|
||||||
if (zoomOffset != null) {
|
if (zoomOffset != null) {
|
||||||
// 如果滚动条有触动就加上滚动条滚动的位置
|
// 如果滚动条有触动就加上滚动条滚动的位置
|
||||||
var density = (imagInfoModel!.boxWidth / imagInfoModel!.scaleWidth!);
|
|
||||||
localPosition = Offset(localPosition.dx + zoomOffset!.dx.abs() / imagInfoModel!.zoom, localPosition.dy);
|
localPosition = Offset(localPosition.dx + zoomOffset!.dx.abs() / imagInfoModel!.zoom, localPosition.dy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (zoomInfo != null) {
|
|
||||||
// localPosition = Offset(details.position.dx, localPosition.dy);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// print('移动位置 zoomOffset==>dx:${zoomOffset?.dx}');
|
|
||||||
// print('移动位置 zoomOffset==>dy:${zoomOffset?.dy}');
|
|
||||||
|
|
||||||
// print('缩放的比例:${_scaleY}');
|
|
||||||
// print('原本的dy:${globalPosition?.dy}');
|
|
||||||
// print('原本的dx:${globalPosition?.dx}');
|
|
||||||
// print('本来的Y轴:${localPosition.dy}');
|
|
||||||
// print('还原后的Y轴:${localPosition.dy * _scaleY}');
|
|
||||||
|
|
||||||
var newVal = ref.read(drawMarkingProvider).data..add(GestureRecording(eraser: graffitiSwitch.openEraser, data: localPosition));
|
var newVal = ref.read(drawMarkingProvider).data..add(GestureRecording(eraser: graffitiSwitch.openEraser, data: localPosition));
|
||||||
var newVal1 = ref.read(drawMarkingProvider).offsets..add(localPosition);
|
var newVal1 = ref.read(drawMarkingProvider).offsets..add(localPosition);
|
||||||
ref.read(drawMarkingProvider.notifier).setState(DrawMarkingVal(newVal, newVal1));
|
ref.read(drawMarkingProvider.notifier).setState(DrawMarkingVal(newVal, newVal1));
|
||||||
},
|
},
|
||||||
onPointerDown: (PointerDownEvent event) {
|
// onPointerDown: (PointerDownEvent event) {
|
||||||
print('手指按下....${event.pointer}');
|
// },
|
||||||
},
|
|
||||||
onPointerUp: (PointerUpEvent details) {
|
onPointerUp: (PointerUpEvent details) {
|
||||||
print('离开.............');
|
|
||||||
if (btnEnum != ReviewMarksBottomBtnsEnum.HANDWRITING) return;
|
if (btnEnum != ReviewMarksBottomBtnsEnum.HANDWRITING) return;
|
||||||
|
|
||||||
globalPosition = null;
|
|
||||||
// 如果在空白区域 非试题图片区域就返回
|
// 如果在空白区域 非试题图片区域就返回
|
||||||
if (illegalArea) return;
|
if (illegalArea) return;
|
||||||
// if (graffitiSwitch.openBrush || graffitiSwitch.openEraser) {
|
|
||||||
// var newVal = ref.read(drawMarkingProvider).data..add(GestureRecording(eraser: graffitiSwitch.openEraser));
|
globalPosition = null;
|
||||||
// ref.read(drawMarkingProvider.notifier).setState(DrawMarkingVal(newVal));
|
|
||||||
// }
|
|
||||||
|
|
||||||
var newVal = ref.read(drawMarkingProvider).data..add(GestureRecording(eraser: graffitiSwitch.openEraser));
|
var newVal = ref.read(drawMarkingProvider).data..add(GestureRecording(eraser: graffitiSwitch.openEraser));
|
||||||
var newVal1 = ref.read(drawMarkingProvider).offsets..add(null);
|
var newVal1 = ref.read(drawMarkingProvider).offsets..add(null);
|
||||||
|
|
@ -440,7 +403,7 @@ class PictureOverviewState extends ConsumerState<PictureOverview> with CommonMix
|
||||||
decoration: const BoxDecoration(color: const Color.fromRGBO(249, 250, 254, 1)),
|
decoration: const BoxDecoration(color: const Color.fromRGBO(249, 250, 254, 1)),
|
||||||
),
|
),
|
||||||
maxZoomWidth: containerWidth,
|
maxZoomWidth: containerWidth,
|
||||||
canvasColor: Colors.red,
|
canvasColor: Colors.transparent,
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
maxZoomHeight: imagInfoModel?.scaleHeight != null ? (imagInfoModel!.scaleHeight! / imagInfoModel!.zoom) : null,
|
maxZoomHeight: imagInfoModel?.scaleHeight != null ? (imagInfoModel!.scaleHeight! / imagInfoModel!.zoom) : null,
|
||||||
initScale: initScale ?? 1,
|
initScale: initScale ?? 1,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue