소스 검색

ImageViewer: Scale image to window size on image change

Lucas CHOLLET 2 년 전
부모
커밋
c574b97246
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      Userland/Applications/ImageViewer/ViewWidget.cpp

+ 5 - 1
Userland/Applications/ImageViewer/ViewWidget.cpp

@@ -192,7 +192,11 @@ void ViewWidget::load_from_file(DeprecatedString const& path)
 
 
     m_path = Core::DeprecatedFile::real_path_for(path);
     m_path = Core::DeprecatedFile::real_path_for(path);
     GUI::Application::the()->set_most_recently_open_file(String::from_utf8(path).release_value_but_fixme_should_propagate_errors());
     GUI::Application::the()->set_most_recently_open_file(String::from_utf8(path).release_value_but_fixme_should_propagate_errors());
-    reset_view();
+
+    if (scaled_for_first_image())
+        scale_image_for_window();
+    else
+        reset_view();
 }
 }
 
 
 void ViewWidget::drag_enter_event(GUI::DragEvent& event)
 void ViewWidget::drag_enter_event(GUI::DragEvent& event)