Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

fix: when image is fully loaded after scaling the image, stay at the same position

ashilkn3f45345aadc1
diff --git a/mobile/lib/ui/viewer/file/zoomable_image.dart b/mobile/lib/ui/viewer/file/zoomable_image.dart
index b55d3a8c9a..5570c4d0b3 100644
--- a/mobile/lib/ui/viewer/file/zoomable_image.dart
+++ b/mobile/lib/ui/viewer/file/zoomable_image.dart
@@ -276,13 +276,8 @@ class _ZoomableImageState extends State<ZoomableImage>
final scale = _photoViewController.scale! /
(finalImageInfo.image.width / prevImageInfo.image.width);
final currentPosition = _photoViewController.value.position;
- final positionScaleFactor = 1 / scale;
- final newPosition = currentPosition.scale(
- positionScaleFactor,
- positionScaleFactor,
- );
_photoViewController = PhotoViewController(
- initialPosition: newPosition,
+ initialPosition: currentPosition,
initialScale: scale,
);
_scaleStateController.scaleState = PhotoViewScaleState.zoomedIn;