Browse Source

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.
Mustafa Quraish 3 years ago
parent
commit
481ed1ca16
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Userland/Applications/ImageViewer/main.cpp

+ 1 - 1
Userland/Applications/ImageViewer/main.cpp

@@ -76,7 +76,7 @@ ErrorOr<int> 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();
         }