1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:17:35 +00:00

LibGfx: Use ErrorOr<T> for Bitmap::scaled()

This commit is contained in:
Andreas Kling 2021-11-06 12:26:04 +01:00
parent db90b4554e
commit 5e41c70e83
4 changed files with 21 additions and 14 deletions

View file

@ -123,7 +123,7 @@ void MonitorWidget::redraw_desktop_if_needed()
float sh = (float)m_desktop_bitmap->height() / (float)m_desktop_resolution.height();
auto scaled_size = m_wallpaper_bitmap->size().to_type<float>().scaled_by(sw, sh).to_type<int>();
auto scaled_bitmap = m_wallpaper_bitmap->scaled(sw, sh);
auto scaled_bitmap = m_wallpaper_bitmap->scaled(sw, sh).release_value_but_fixme_should_propagate_errors();
if (m_desktop_wallpaper_mode == "center") {
auto centered_rect = Gfx::IntRect({}, scaled_size).centered_within(m_desktop_bitmap->rect());