mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 12:49:19 +00:00
PixelPaint: Add invert filter
This commit is contained in:
parent
280cbf2e18
commit
81326ac8c7
Notes:
sideshowbarker
2024-07-18 04:48:18 +09:00
Author: https://github.com/musabkilic
Commit: 81326ac8c7
Pull-request: https://github.com/SerenityOS/serenity/pull/9753
Reviewed-by: https://github.com/mustafaquraish ✅
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