fix(mobile): prevent snapping to center on pinch-to-zoom release (#29207) (#29343)

Co-authored-by: cmdpromptcritical <cmdpromptcritical@github.com>
This commit is contained in:
cmdPromptCritical 2026-08-14 15:30:28 -04:00 committed by GitHub
parent 190a939af7
commit 66d010381e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -203,7 +203,7 @@ class PhotoViewCoreState extends State<PhotoViewCore>
} else if (scaleState == PhotoViewScaleState.zoomedIn) { } else if (scaleState == PhotoViewScaleState.zoomedIn) {
animateRotation(controller.rotation, 0); animateRotation(controller.rotation, 0);
if (_shouldAllowPanRotate()) { if (_shouldAllowPanRotate()) {
animatePosition(controller.position, Offset.zero); animatePosition(controller.position, clampPosition());
} }
} }