fix zoom/pan glitch on plane photos

When changing to a different photo, it can be the case that the new photo has a different aspect ratio: the zoom behaviour needs to be updated.

Also, keeping the "orientation" does not make sense for plane photos, and even keeping the previously shown photo's zoom is also not typically desired for these.
This commit is contained in:
Martin Raifer
2024-06-26 13:12:26 +02:00
parent 6b0d6f7017
commit 21d99715a7
2 changed files with 7 additions and 9 deletions

View File

@@ -475,11 +475,10 @@ label.streetside-hires {
transform-origin: 0 0;
}
.photoviewer .plane-frame > img.plane-photo{
width: 100%;
.photoviewer .plane-frame > img.plane-photo {
width: auto;
height: 100%;
object-fit: cover;
overflow: hidden;
transform-origin: 0 0;
}
/* photo-controls (step forward, back, rotate) */

View File

@@ -87,14 +87,13 @@ export default {
selectPhoto: function (data, keepOrientation) {
dispatch.call('viewerChanged');
loadImage(_photo, '');
loadImage(_photo, data.image_path)
.then(() => {
if (!keepOrientation) {
imgZoom = zoomBeahvior();
_wrapper.call(imgZoom);
_wrapper.call(imgZoom.transform, d3_zoomIdentity.translate(-_widthOverflow / 2, 0));
}
imgZoom = zoomBeahvior();
_wrapper.call(imgZoom);
_wrapper.call(imgZoom.transform, d3_zoomIdentity.translate(-_widthOverflow / 2, 0));
});
return this;
},