Make inspector never upscale in fit-to-window mode

When zoomed completely out, don't upscale images.
This commit is contained in:
Lawrence Lee 2021-05-09 12:18:06 -07:00
parent 9df34be6cb
commit 6535cb4a94

View File

@ -432,7 +432,7 @@ bool Inspector::on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr)
availableSize.y = win->get_height() * deviceScale;
int imW = rtengine::max<int>(currImage->imgBuffer.getWidth(), 1);
int imH = rtengine::max<int>(currImage->imgBuffer.getHeight(), 1);
scale = rtengine::min<double>(availableSize.x / imW, availableSize.y / imH);
scale = rtengine::min(1., rtengine::min<double>(availableSize.x / imW, availableSize.y / imH));
if (scaled) {
// reduce size of image to fit into window, no further zoom down
zoomScale = rtengine::max<double>(zoomScale, 1.0);