mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
fix(mobile): preserve zoom level when new images load in asset viewer
This commit is contained in:
@@ -145,7 +145,15 @@ class _ImageWrapperState extends State<ImageWrapper> {
|
|||||||
_lastStack = null;
|
_lastStack = null;
|
||||||
|
|
||||||
_didLoadSynchronously = synchronousCall;
|
_didLoadSynchronously = synchronousCall;
|
||||||
|
final oldBoundaries = widget.controller.scaleBoundaries;
|
||||||
widget.controller.scaleBoundaries = 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);
|
synchronousCall && !_didLoadSynchronously ? setupCB() : setState(setupCB);
|
||||||
|
|||||||
Reference in New Issue
Block a user