1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:38:11 +00:00

ImageViewer: Do not resize the window if the image fits into the window

This commit is contained in:
Aziz Berkay Yesilyurt 2021-07-13 23:43:19 +02:00 committed by Andreas Kling
parent 63e78ccd9f
commit 41ebb12c9e

View file

@ -277,7 +277,12 @@ void ViewWidget::drop_event(GUI::DropEvent& event)
void ViewWidget::resize_window()
{
if (window()->is_fullscreen())
if (window()->is_fullscreen() || window()->is_maximized())
return;
auto absolute_bitmap_rect = m_bitmap_rect;
absolute_bitmap_rect.translate_by(window()->rect().top_left());
if (window()->rect().contains(absolute_bitmap_rect))
return;
if (!m_bitmap)