mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:37:35 +00:00
PixelPaint: Add invert filter
This commit is contained in:
parent
280cbf2e18
commit
81326ac8c7
3 changed files with 56 additions and 0 deletions
|
@ -724,6 +724,16 @@ int main(int argc, char** argv)
|
|||
editor->did_complete_action();
|
||||
}
|
||||
}));
|
||||
color_filters_menu.add_action(GUI::Action::create("Invert", [&](auto&) {
|
||||
auto* editor = current_image_editor();
|
||||
if (!editor)
|
||||
return;
|
||||
if (auto* layer = editor->active_layer()) {
|
||||
Gfx::InvertFilter filter;
|
||||
filter.apply(layer->bitmap(), layer->rect(), layer->bitmap(), layer->rect());
|
||||
editor->did_complete_action();
|
||||
}
|
||||
}));
|
||||
|
||||
auto& help_menu = window->add_menu("&Help");
|
||||
help_menu.add_action(GUI::CommonActions::make_about_action("Pixel Paint", app_icon, window));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue