show video restore btn if translated

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-11-17 21:39:53 +08:00
parent 0f8166620e
commit de03bef226
4 changed files with 18 additions and 7 deletions

View File

@@ -936,7 +936,8 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
}
void _onInteractionUpdate(ScaleUpdateDetails details) {
showRestoreScaleBtn.value = transformationController.value.row0.x != 1.0;
showRestoreScaleBtn.value =
transformationController.value.storage[0] != 1.0;
if (interacting || plPlayerController.initialFocalPoint == Offset.zero) {
return;
}
@@ -2071,6 +2072,13 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
: EdgeInsets.zero,
panAxis: PanAxis.aligned,
transformationController: transformationController,
onTranslate: () {
final storage = transformationController.value.storage;
showRestoreScaleBtn.value =
storage[12].abs() > 2.0 ||
storage[13].abs() > 2.0 ||
storage[0] != 1.0;
},
childKey: _videoKey,
child: RepaintBoundary(
key: _videoKey,