mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 16:47:42 +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
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