Skip to content

Commit

Permalink
When changing format, if viewer is not zoomed or panned then fit to f…
Browse files Browse the repository at this point in the history
…ormat
  • Loading branch information
MrKepzie committed Oct 11, 2016
1 parent 4c6623c commit 2f35bee
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Bugs

- Viewer is not refreshing when the reader's paths contain unicode characters https://github.com/MrKepzie/Natron/issues/1416
- Windows: If Natron is not installed in Program Files using the installer, Fontconfig does not work properly thus the Text node will not work

# History

Expand All @@ -13,6 +13,9 @@
- PyPlug: fix a bug where removing a node inside a Group would break any expression on its siblings
- Reader: fix a bug where copy/pasting a node would display a "Bad Image Format" error
- The whole user interface now uses the same font, and dialogs were cleaned up to use standard buttons
- Roto: fix a bug where the selected tool in the viewer would not refresh properly
- Fix a bug where Natron would not work properly when installed in a directory containing unicode characters
- OpenEXR: fix a bug where auto-crop files would not have their origin placed correctly

### Plugins

Expand Down
10 changes: 7 additions & 3 deletions Gui/ViewerGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3052,9 +3052,13 @@ ViewerGL::setFormat(const std::string& formatName, const RectD& format, double p
if ( !_imp->viewerTab->getGui() ) {
return;
}

_imp->displayTextures[textureIndex].format = format;
_imp->displayTextures[textureIndex].pixelAspectRatio = par;
if (_imp->displayTextures[textureIndex].format != format || _imp->displayTextures[textureIndex].pixelAspectRatio != par) {
_imp->displayTextures[textureIndex].format = format;
_imp->displayTextures[textureIndex].pixelAspectRatio = par;
if (!getZoomOrPannedSinceLastFit() && _imp->zoomCtx.screenWidth() != 0 && _imp->zoomCtx.screenHeight() != 0) {
fitImageToFormat();
}
}

_imp->currentViewerInfo_resolutionOverlay[textureIndex] = QString::fromUtf8(formatName.c_str());
}
Expand Down

0 comments on commit 2f35bee

Please sign in to comment.