diff options
author | Andreas Kling <kling@serenityos.org> | 2021-11-06 16:25:29 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-11-08 00:35:27 +0100 |
commit | 235f39e449ebffed26114c7166b0b632a3f2232e (patch) | |
tree | 3f61715fe8ba3e801803bde270ca4aeca74fd9f5 /Userland/Demos/LibGfxDemo | |
parent | 16f064d9bea97b499843e1a90a545a738d9c35fd (diff) | |
download | serenity-235f39e449ebffed26114c7166b0b632a3f2232e.zip |
LibGfx: Use ErrorOr<T> for Bitmap::try_load_from_file()
This was used in a lot of places, so this patch makes liberal use of
ErrorOr<T>::release_value_but_fixme_should_propagate_errors().
Diffstat (limited to 'Userland/Demos/LibGfxDemo')
-rw-r--r-- | Userland/Demos/LibGfxDemo/main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Demos/LibGfxDemo/main.cpp b/Userland/Demos/LibGfxDemo/main.cpp index f7a07fbc9b..b2183ba03d 100644 --- a/Userland/Demos/LibGfxDemo/main.cpp +++ b/Userland/Demos/LibGfxDemo/main.cpp @@ -108,7 +108,7 @@ void Canvas::draw() painter.draw_line({ 740, 140 }, { 640, 240 }, Color::Red, 5, Gfx::Painter::LineStyle::Solid); painter.draw_line({ 690, 140 }, { 640, 240 }, Color::Blue, 10, Gfx::Painter::LineStyle::Solid); - auto bg = Gfx::Bitmap::try_load_from_file("/res/html/misc/90s-bg.png"); + auto bg = Gfx::Bitmap::try_load_from_file("/res/html/misc/90s-bg.png").release_value_but_fixme_should_propagate_errors(); painter.draw_tiled_bitmap({ 20, 260, 480, 320 }, *bg); painter.draw_line({ 40, 480 }, { 20, 260 }, Color::Red); @@ -129,7 +129,7 @@ void Canvas::draw() path.close(); painter.fill_path(path, Color::Yellow, Gfx::Painter::WindingRule::EvenOdd); - auto buggie = Gfx::Bitmap::try_load_from_file("/res/graphics/buggie.png"); + auto buggie = Gfx::Bitmap::try_load_from_file("/res/graphics/buggie.png").release_value_but_fixme_should_propagate_errors(); painter.blit({ 280, 280 }, *buggie, buggie->rect(), 0.5); painter.draw_scaled_bitmap({ 360, 280, buggie->rect().width() * 2, buggie->rect().height() * 2 }, *buggie, buggie->rect()); |