mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 22:18:12 +00:00
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.
This commit is contained in:
parent
5c763e9832
commit
481ed1ca16
1 changed files with 1 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue