mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-08 10:36:02 +00:00
ImageViewer: Fix crash when opening ImageViewer without an image
Seems like a thing which slipped through the cracks... We shouldn't try to scale the image to the window's size if the bitmap doesn't exist.
This commit is contained in:
parent
34224c42ef
commit
ac5f4792a8
Notes:
sideshowbarker
2024-07-17 17:40:13 +09:00
Author: https://github.com/caoimhebyrne
Commit: ac5f4792a8
Pull-request: https://github.com/SerenityOS/serenity/pull/18017
1 changed files with 3 additions and 0 deletions
|
@ -221,6 +221,9 @@ void ViewWidget::resize_event(GUI::ResizeEvent& event)
|
||||||
|
|
||||||
void ViewWidget::scale_image_for_window()
|
void ViewWidget::scale_image_for_window()
|
||||||
{
|
{
|
||||||
|
if (!m_bitmap)
|
||||||
|
return;
|
||||||
|
|
||||||
set_original_rect(m_bitmap->rect());
|
set_original_rect(m_bitmap->rect());
|
||||||
fit_content_to_view(GUI::AbstractZoomPanWidget::FitType::Both);
|
fit_content_to_view(GUI::AbstractZoomPanWidget::FitType::Both);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue