summaryrefslogtreecommitdiff
path: root/Userland/Applications/ImageViewer/ViewWidget.cpp
diff options
context:
space:
mode:
authorNícolas F. R. A. Prado <n@nfraprado.net>2021-10-18 23:58:30 -0500
committerAndreas Kling <kling@serenityos.org>2021-10-19 18:24:20 +0200
commit72f1e23e6be3763e0dcfef2f3030aee1a2815546 (patch)
treee126739ddb887f56b924472aa11d6cf2d71ca575 /Userland/Applications/ImageViewer/ViewWidget.cpp
parent05d7ac1193ef0e01724bfdf0f35ea57a0b16af59 (diff)
downloadserenity-72f1e23e6be3763e0dcfef2f3030aee1a2815546.zip
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.
Diffstat (limited to 'Userland/Applications/ImageViewer/ViewWidget.cpp')
-rw-r--r--Userland/Applications/ImageViewer/ViewWidget.cpp2
1 files changed, 1 insertions, 1 deletions
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);