Skip to content

Commit

Permalink
Fix combination of zoom default: original size + window matches image…
Browse files Browse the repository at this point in the history
… size

Fit/constrain logic was running too early. This only mattered for Original Size mode, but the other zoom modes were fine because the window resize event triggers another zoom recalculation in those cases.
  • Loading branch information
jdpurcell committed Aug 12, 2024
1 parent a2d0e95 commit 9642cbe
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/qvgraphicsview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,22 +503,21 @@ void QVGraphicsView::postLoad()
// Set the pixmap to the new image and reset the transform's scale to a known value
removeExpensiveScaling();

qvApp->getActionManager().addFileToRecentsList(getCurrentFileDetails().fileInfo);

emit fileChanged(loadIsFromSessionRestore);

if (!loadIsFromSessionRestore)
{
if (navigationResetsZoom && calculatedZoomMode != defaultCalculatedZoomMode)
setCalculatedZoomMode(defaultCalculatedZoomMode, true);
else
fitOrConstrainImage();
}
loadIsFromSessionRestore = false;

expensiveScaleTimer->start();

qvApp->getActionManager().addFileToRecentsList(getCurrentFileDetails().fileInfo);

emit fileChanged(loadIsFromSessionRestore);

loadIsFromSessionRestore = false;

if (turboNavMode.has_value())
{
const qint64 navDelay = qMax(turboNavInterval - lastTurboNav.elapsed(), 0LL);
Expand Down

0 comments on commit 9642cbe

Please sign in to comment.