From 481ed1ca16169d62b5857e386c3ffad7ef151cc0 Mon Sep 17 00:00:00 2001 From: Mustafa Quraish Date: Fri, 21 Jan 2022 03:46:50 -0500 Subject: [PATCH] ImageViewer: Fix window resizing on first image The logic in place for this no longer worked since we abstracted away the logic for zooming / panning (which changed how scale is stored). This commit fixes the behaviour so when the first image is opened, the window resizes to fit it. --- Userland/Applications/ImageViewer/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Applications/ImageViewer/main.cpp b/Userland/Applications/ImageViewer/main.cpp index 125035befb..6dd596e1c6 100644 --- a/Userland/Applications/ImageViewer/main.cpp +++ b/Userland/Applications/ImageViewer/main.cpp @@ -76,7 +76,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_title(String::formatted("{} {} {}% - Image Viewer", widget->path(), widget->bitmap()->size().to_string(), (int)(scale * 100))); - if (scale == 100 && !widget->scaled_for_first_image()) { + if (!widget->scaled_for_first_image()) { widget->set_scaled_for_first_image(true); widget->resize_window(); }