Skip to content

Commit

Permalink
[ui] float image viewer: factorize targetSize computation
Browse files Browse the repository at this point in the history
  • Loading branch information
mugulmd committed Aug 21, 2023
1 parent 522d838 commit 4d4d817
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions meshroom/ui/qml/Viewer/Viewer2D.qml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ FocusScope {
imgContainer.x += (1-zoomFactor) * point.x * imgContainer.scale;
imgContainer.y += (1-zoomFactor) * point.y * imgContainer.scale;
imgContainer.scale *= zoomFactor;
floatImageViewerLoader.targetSize *= zoomFactor;
}
}

Expand Down Expand Up @@ -168,9 +167,6 @@ FocusScope {
// so that container center corresponds to image center
imgContainer.x += (orientedWidth - imgContainer.image.width) * 0.5 * imgContainer.scale;
imgContainer.y += (orientedHeight - imgContainer.image.height) * 0.5 * imgContainer.scale;

// reset target size
floatImageViewerLoader.targetSize = Math.max(imgLayout.width, root.height);
}

function tryLoadNode(node) {
Expand Down Expand Up @@ -443,7 +439,7 @@ FocusScope {
property bool fittedOnce: false
property int previousWidth: 0
property int previousHeight: 0
property real targetSize: 1000
property real targetSize: Math.max(width, height) * imgContainer.scale;
onHeightChanged: {
/* Image size is not updated through a single signal with the floatImage viewer, unlike
* the simple QML image viewer: instead of updating straight away the width and height to x and
Expand Down

0 comments on commit 4d4d817

Please sign in to comment.