feat(mobile): limit max zoom by image pixel size (#32423)

* fix(mobile): limit max zoom by visible image pixels

* fix(mobile): limit max zoom by image pixel size

(cherry picked from commit b246fa7c8a458da2d89c0efa2b2a8db85182ea9c)
This commit is contained in:
Luis Nachtigall
2026-10-14 21:24:14 +03:00
committed by Codex
parent c318714fdc
commit 645f333d04
@@ -57,7 +57,7 @@ class _AssetPageState extends ConsumerState<AssetPage> {
final _scrollController = SnapScrollController();
double _snapOffset = 0.0;
static const double _maxScaleMultiplier = 20.0;
static const double _maxImagePixelSize = 12.0;
DragStartDetails? _dragStart;
_DragIntent _dragIntent = _DragIntent.none;
@@ -374,7 +374,7 @@ class _AssetPageState extends ConsumerState<AssetPage> {
filterQuality: FilterQuality.high,
tightMode: true,
enablePanAlways: true,
maxScale: PhotoViewComputedScale.contained * _maxScaleMultiplier,
maxScale: _maxImagePixelSize,
disableScaleGestures: _showingDetails,
scaleStateChangedCallback: _onScaleStateChanged,
onPageBuild: _onPageBuild,
@@ -409,7 +409,7 @@ class _AssetPageState extends ConsumerState<AssetPage> {
basePosition: Alignment.center,
disableScaleGestures: _showingDetails,
minScale: PhotoViewComputedScale.contained,
maxScale: PhotoViewComputedScale.contained * _maxScaleMultiplier,
maxScale: _maxImagePixelSize,
initialScale: PhotoViewComputedScale.contained,
tightMode: true,
onPageBuild: _onPageBuild,