1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 01:51:03 +09: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:
Mustafa Quraish 2022-01-21 03:46:50 -05:00 committed by Andreas Kling
parent 5c763e9832
commit 481ed1ca16
Notes: sideshowbarker 2024-07-17 18:50:30 +09:00

View file

@ -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();
}