mirror of
https://github.com/immich-app/immich.git
synced 2026-04-25 02:19:58 -04:00
fix(mobile): preserve zoom level when new images load in asset viewer
This commit is contained in:
parent
312bb91a4f
commit
276b42d3ff
@ -145,7 +145,15 @@ class _ImageWrapperState extends State<ImageWrapper> {
|
||||
_lastStack = null;
|
||||
|
||||
_didLoadSynchronously = synchronousCall;
|
||||
final oldBoundaries = widget.controller.scaleBoundaries;
|
||||
widget.controller.scaleBoundaries = scaleBoundaries;
|
||||
if (oldBoundaries != null) {
|
||||
final ratio = scaleBoundaries.initialScale / oldBoundaries.initialScale;
|
||||
final currentScale = widget.controller.scale;
|
||||
if (currentScale != null) {
|
||||
widget.controller.setScaleInvisibly(currentScale * ratio);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
synchronousCall && !_didLoadSynchronously ? setupCB() : setState(setupCB);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user