From 72f1e23e6be3763e0dcfef2f3030aee1a2815546 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= Date: Mon, 18 Oct 2021 23:58:30 -0500 Subject: [PATCH] ImageViewer: Use scaled image size when resizing window to fit it When the image is flipped or rotated, the window is resized to ensure that the image still fits in the frame. However, currently the original bitmap rect is used, which doesn't take into account the scaling factor. Fix this by using the scaled rect instead. --- Userland/Applications/ImageViewer/ViewWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Applications/ImageViewer/ViewWidget.cpp b/Userland/Applications/ImageViewer/ViewWidget.cpp index c851668ec7..3623a01eff 100644 --- a/Userland/Applications/ImageViewer/ViewWidget.cpp +++ b/Userland/Applications/ImageViewer/ViewWidget.cpp @@ -299,7 +299,7 @@ void ViewWidget::resize_window() if (!m_bitmap) return; - auto new_size = m_bitmap->size(); + auto new_size = m_bitmap_rect.size(); if (new_size.width() < 300) new_size.set_width(300);