mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-04 08:36:12 +00:00
PixelPaint: Rename Layer::create_foo() => Layer::try_create_foo()
This commit is contained in:
parent
a9e98bad8a
commit
9c5de113b1
Notes:
sideshowbarker
2024-07-18 12:23:19 +09:00
Author: https://github.com/awesomekling
Commit: 9c5de113b1
4 changed files with 29 additions and 21 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -10,7 +10,7 @@
|
|||
|
||||
namespace PixelPaint {
|
||||
|
||||
RefPtr<Layer> Layer::create_with_size(Image& image, Gfx::IntSize const& size, String const& name)
|
||||
RefPtr<Layer> Layer::try_create_with_size(Image& image, Gfx::IntSize const& size, String const& name)
|
||||
{
|
||||
if (size.is_empty())
|
||||
return nullptr;
|
||||
|
@ -21,7 +21,7 @@ RefPtr<Layer> Layer::create_with_size(Image& image, Gfx::IntSize const& size, St
|
|||
return adopt_ref(*new Layer(image, size, name));
|
||||
}
|
||||
|
||||
RefPtr<Layer> Layer::create_with_bitmap(Image& image, Gfx::Bitmap const& bitmap, String const& name)
|
||||
RefPtr<Layer> Layer::try_create_with_bitmap(Image& image, Gfx::Bitmap const& bitmap, String const& name)
|
||||
{
|
||||
if (bitmap.size().is_empty())
|
||||
return nullptr;
|
||||
|
@ -32,9 +32,9 @@ RefPtr<Layer> Layer::create_with_bitmap(Image& image, Gfx::Bitmap const& bitmap,
|
|||
return adopt_ref(*new Layer(image, bitmap, name));
|
||||
}
|
||||
|
||||
RefPtr<Layer> Layer::create_snapshot(Image& image, Layer const& layer)
|
||||
RefPtr<Layer> Layer::try_create_snapshot(Image& image, Layer const& layer)
|
||||
{
|
||||
auto snapshot = create_with_bitmap(image, *layer.bitmap().clone(), layer.name());
|
||||
auto snapshot = try_create_with_bitmap(image, *layer.bitmap().clone(), layer.name());
|
||||
/*
|
||||
We set these properties directly because calling the setters might
|
||||
notify the image of an update on the newly created layer, but this
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue