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

PixelPaint: Remove try_ prefix from fallible Image methods

This commit is contained in:
Linus Groh 2023-01-28 20:12:17 +00:00 committed by Jelle Raaijmakers
parent 39f1a6eb6f
commit 8a884b2581
5 changed files with 32 additions and 32 deletions

View file

@ -517,11 +517,11 @@ ErrorOr<void> ImageEditor::add_new_layer_from_selection()
// save offsets of selection so we know where to place the new layer
auto selection_offset = current_layer_selection.bounding_rect().location();
auto selection_bitmap = active_layer()->try_copy_bitmap(current_layer_selection);
auto selection_bitmap = active_layer()->copy_bitmap(current_layer_selection);
if (selection_bitmap.is_null())
return Error::from_string_literal("Unable to create bitmap from selection.");
auto layer_or_error = PixelPaint::Layer::try_create_with_bitmap(image(), selection_bitmap.release_nonnull(), "New Layer"sv);
auto layer_or_error = PixelPaint::Layer::create_with_bitmap(image(), selection_bitmap.release_nonnull(), "New Layer"sv);
if (layer_or_error.is_error())
return Error::from_string_literal("Unable to create layer from selection.");