|
@@ -409,32 +409,38 @@ class _MeasureMainViewState extends State<MeasureMainView> {
|
|
|
playerController as VidPlayerController,
|
|
|
),
|
|
|
),
|
|
|
- if (canMeasure && canMeasureDrawing) ...[
|
|
|
+ if (canMeasure) ...[
|
|
|
LayoutId(
|
|
|
id: _LayerLayoutIds.recordsCanvas,
|
|
|
- child: const MeasureRecordsCanvasPanel(),
|
|
|
+ child: _enableMeasureOffstageWrap(
|
|
|
+ const MeasureRecordsCanvasPanel()),
|
|
|
),
|
|
|
LayoutId(
|
|
|
id: _LayerLayoutIds.activeMeasure,
|
|
|
- child: const MeasureActiveCanvasPanel(),
|
|
|
+ child: _enableMeasureOffstageWrap(
|
|
|
+ const MeasureActiveCanvasPanel()),
|
|
|
),
|
|
|
LayoutId(
|
|
|
id: _LayerLayoutIds.activeAnnotation,
|
|
|
- child: const AnnotationCanvas(),
|
|
|
+ child: _enableMeasureOffstageWrap(
|
|
|
+ const AnnotationCanvas()),
|
|
|
),
|
|
|
if (application.isThirdPart)
|
|
|
LayoutId(
|
|
|
id: _LayerLayoutIds.standardLineCalibration,
|
|
|
- child: StandardLineCalibrationCanvas(
|
|
|
- standardLineCalibrationController!),
|
|
|
+ child: _enableMeasureOffstageWrap(
|
|
|
+ StandardLineCalibrationCanvas(
|
|
|
+ standardLineCalibrationController!)),
|
|
|
),
|
|
|
LayoutId(
|
|
|
id: _LayerLayoutIds.gesture,
|
|
|
- child: _buildGestureLayer(),
|
|
|
+ child: _enableMeasureOffstageWrap(
|
|
|
+ _buildGestureLayer()),
|
|
|
),
|
|
|
LayoutId(
|
|
|
id: _LayerLayoutIds.result,
|
|
|
- child: const MeasureResultPanel(),
|
|
|
+ child: _enableMeasureOffstageWrap(
|
|
|
+ const MeasureResultPanel()),
|
|
|
),
|
|
|
],
|
|
|
if (canMeasure)
|
|
@@ -539,6 +545,14 @@ class _MeasureMainViewState extends State<MeasureMainView> {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ /// 仅当 canMeasureDrawing 为 true 时才显示的 Offstage 包装
|
|
|
+ Widget _enableMeasureOffstageWrap(Widget child) {
|
|
|
+ return Offstage(
|
|
|
+ offstage: !canMeasureDrawing,
|
|
|
+ child: child,
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
Widget _buildGestureLayer() {
|
|
|
if (application.isThirdPart) {
|
|
|
if (standardLineCalibrationController!.isEditing) {
|