mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-11 20:16:02 +00:00
PixelPaint: Add "Apply Mask" action
This commit adds a "Apply Mask" action which merges the active layer mask with the layer bitmap. The option is only displayed if the active layer is masked.
This commit is contained in:
parent
062c9efa88
commit
799d570afc
Notes:
sideshowbarker
2024-07-16 23:43:44 +09:00
Author: https://github.com/tcl3
Commit: 799d570afc
Pull-request: https://github.com/SerenityOS/serenity/pull/17611
4 changed files with 20 additions and 0 deletions
|
@ -324,6 +324,14 @@ void Layer::delete_mask()
|
|||
update_cached_bitmap();
|
||||
}
|
||||
|
||||
void Layer::apply_mask()
|
||||
{
|
||||
m_content_bitmap->fill(Color::Transparent);
|
||||
Gfx::Painter painter(m_content_bitmap);
|
||||
painter.blit({}, m_cached_display_bitmap, m_cached_display_bitmap->rect());
|
||||
delete_mask();
|
||||
}
|
||||
|
||||
Gfx::Bitmap& Layer::currently_edited_bitmap()
|
||||
{
|
||||
switch (edit_mode()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue