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

PixelPaint: Add a Duplicate Layer action

The "Duplicate Layer" action inserts a copy of the selected layer into
the layer stack. The new layer is placed above the selected layer.
This commit is contained in:
Tim Ledbetter 2023-03-24 17:51:24 +00:00 committed by Jelle Raaijmakers
parent 55feecee36
commit 3faf089be5
7 changed files with 83 additions and 3 deletions

View file

@ -65,6 +65,7 @@ public:
Gfx::IntRect rect() const { return { {}, m_size }; }
void add_layer(NonnullRefPtr<Layer>);
void insert_layer(NonnullRefPtr<Layer>, size_t index);
ErrorOr<NonnullRefPtr<Image>> take_snapshot() const;
ErrorOr<void> restore_snapshot(Image const&);
@ -124,6 +125,8 @@ private:
ErrorOr<void> merge_layers(LayerMergeMode);
ErrorOr<void> merge_active_layer(NonnullRefPtr<Layer> const&, LayerMergeDirection);
DeprecatedString generate_unique_layer_name(DeprecatedString const& original_name);
Gfx::IntSize m_size;
Vector<NonnullRefPtr<Layer>> m_layers;