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

PixelPaint: Add method to flatten image layers

This adds Image::flatten_all_layers() that allows the user to flatten
all the visible layers into one.
This commit is contained in:
Marcus Nilsson 2021-07-05 22:42:43 +02:00 committed by Andreas Kling
parent 76a18e1172
commit 9be08e33ea
4 changed files with 30 additions and 0 deletions

View file

@ -408,6 +408,16 @@ int main(int argc, char** argv)
layer_list_widget.on_context_menu_request = [&](auto& event) {
layer_menu.popup(event.screen_position());
};
layer_menu.add_separator();
layer_menu.add_action(GUI::Action::create(
"&Flatten Image", { Mod_Ctrl, Key_F }, [&](auto&) {
auto* editor = current_image_editor();
if (!editor)
return;
editor->image().flatten_all_layers();
editor->did_complete_action();
},
window));
auto& filter_menu = menubar->add_menu("&Filter");
auto& spatial_filters_menu = filter_menu.add_submenu("&Spatial");