Skip to content

Commit

Permalink
[qt6][Viewer] Viewer2D: Fix automatic fitting for missing orientation…
Browse files Browse the repository at this point in the history
… tags
  • Loading branch information
cbentejac committed Oct 17, 2024
1 parent fd1636c commit 91fcbe0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions meshroom/ui/qml/Viewer/Viewer2D.qml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ FocusScope {
// Functions
function fit() {
// Make sure the image is ready for use
if (!imgContainer.image || imgContainer.orientationTag == undefined) {
if (!imgContainer.image) {
return false
}

Expand Down Expand Up @@ -480,7 +480,7 @@ FocusScope {
property bool fittedOnce: false
property int previousWidth: 0
property int previousHeight: 0
property int previousOrientationTag: 1
property int previousOrientationTag: -1
property real targetSize: Math.max(width, height) * imgContainer.scale
onWidthChanged: {
/* We want to do the auto-fit on the first display of an image from the group, and then keep its
Expand All @@ -498,8 +498,9 @@ FocusScope {
previousWidth = width
previousHeight = height

if (orientationTag != undefined)
if (orientationTag != undefined) {
previousOrientationTag = orientationTag
}
}
}

Expand Down

0 comments on commit 91fcbe0

Please sign in to comment.