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

PixelPaint: Use move semantics around Layer construction and accessors

This commit is contained in:
Andreas Kling 2021-06-12 09:45:07 +02:00
parent a612c22278
commit c7f7c1f7f0
3 changed files with 19 additions and 17 deletions

View file

@ -98,7 +98,9 @@ RefPtr<Image> Image::try_create_from_pixel_paint_file(String const& file_path)
auto bitmap_base64_encoded = json_layer_object.get("bitmap").as_string();
auto bitmap_data = decode_base64(bitmap_base64_encoded);
auto image_decoder = Gfx::ImageDecoder::create(bitmap_data);
layer->set_bitmap(*image_decoder->bitmap());
auto bitmap = image_decoder->bitmap();
VERIFY(bitmap);
layer->set_bitmap(bitmap.release_nonnull());
image->add_layer(*layer);
});