1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:57:45 +00:00

PixelPaint: Add actions to rotate image left/right

This also required adding a new hook to `ImageClient`, since there
wasn't a way of telling the ImageEditor that the full rect of the
image has changed (as when we rotate).
This commit is contained in:
Mustafa Quraish 2021-09-02 19:29:03 -04:00 committed by Andreas Kling
parent 6a8c408856
commit ca6c9be94c
5 changed files with 46 additions and 0 deletions

View file

@ -424,6 +424,22 @@ int main(int argc, char** argv)
editor->image().flip(Gfx::Orientation::Horizontal);
},
window));
image_menu.add_action(GUI::Action::create(
"Rotate &Left", [&](auto&) {
auto* editor = current_image_editor();
if (!editor)
return;
editor->image().rotate(Gfx::RotationDirection::CounterClockwise);
},
window));
image_menu.add_action(GUI::Action::create(
"Rotate &Right", [&](auto&) {
auto* editor = current_image_editor();
if (!editor)
return;
editor->image().rotate(Gfx::RotationDirection::Clockwise);
},
window));
auto& layer_menu = window->add_menu("&Layer");
layer_menu.add_action(GUI::Action::create(