mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:47:35 +00:00
PixelPaint: Save layer mask when adding to the UndoStack
This makes undoing actions performed on layer masks work as expected. did_modify_bitmap() is now also called on redo, to ensure the layer mask is displayed correctly.
This commit is contained in:
parent
34567bc145
commit
f1a792e6c9
2 changed files with 5 additions and 0 deletions
|
@ -237,6 +237,7 @@ ErrorOr<void> Image::restore_snapshot(Image const& snapshot)
|
||||||
select_layer(layer.ptr());
|
select_layer(layer.ptr());
|
||||||
layer_selected = true;
|
layer_selected = true;
|
||||||
}
|
}
|
||||||
|
layer->did_modify_bitmap({}, Layer::NotifyClients::No);
|
||||||
add_layer(*layer);
|
add_layer(*layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,10 @@ ErrorOr<NonnullRefPtr<Layer>> Layer::create_snapshot(Image& image, Layer const&
|
||||||
{
|
{
|
||||||
auto bitmap = TRY(layer.content_bitmap().clone());
|
auto bitmap = TRY(layer.content_bitmap().clone());
|
||||||
auto snapshot = TRY(create_with_bitmap(image, move(bitmap), layer.name()));
|
auto snapshot = TRY(create_with_bitmap(image, move(bitmap), layer.name()));
|
||||||
|
if (layer.is_masked()) {
|
||||||
|
snapshot->m_mask_bitmap = TRY(layer.mask_bitmap()->clone());
|
||||||
|
snapshot->m_edit_mode = layer.m_edit_mode;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
We set these properties directly because calling the setters might
|
We set these properties directly because calling the setters might
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue