opt: restore scale btn

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-02-10 19:58:44 +08:00
parent bc2dbc59ce
commit 6114e6f033
2 changed files with 5 additions and 5 deletions

View File

@@ -1612,5 +1612,5 @@ class PlPlayerController {
late final RxList dmTrend = [].obs; late final RxList dmTrend = [].obs;
late final RxBool showDmChart = true.obs; late final RxBool showDmChart = true.obs;
late final RxDouble videoScale = 1.0.obs; late final RxBool showRestoreScaleBtn = false.obs;
} }

View File

@@ -704,8 +704,8 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
}, },
onInteractionUpdate: (ScaleUpdateDetails details) { onInteractionUpdate: (ScaleUpdateDetails details) {
plPlayerController.videoScale.value = plPlayerController.showRestoreScaleBtn.value =
transformationController.value.row0.x; transformationController.value.row0.x != 1.0;
if (interacting || _initialFocalPoint == Offset.zero) return; if (interacting || _initialFocalPoint == Offset.zero) return;
Offset cumulativeDelta = Offset cumulativeDelta =
details.localFocalPoint - _initialFocalPoint; details.localFocalPoint - _initialFocalPoint;
@@ -1147,7 +1147,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
// ), // ),
Obx( Obx(
() => plPlayerController.videoScale.value != 1 && () => plPlayerController.showRestoreScaleBtn.value &&
plPlayerController.showControls.value plPlayerController.showControls.value
? Align( ? Align(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
@@ -1169,7 +1169,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
), ),
), ),
onPressed: () async { onPressed: () async {
plPlayerController.videoScale.value = 1.0; plPlayerController.showRestoreScaleBtn.value = false;
final animController = AnimationController( final animController = AnimationController(
vsync: this, vsync: this,
duration: const Duration(milliseconds: 255), duration: const Duration(milliseconds: 255),