mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:47:45 +00:00
PixelPaint: Add Fit Image To View
action
This is a feature I missed from Photoshop: it sets the scale and position so that the image fits (it's longest dimension) into the editor view. There's a 5% border left around the image to provide context. This is just arbitrary seemed like the right amount after some trial and error.
This commit is contained in:
parent
111ef19114
commit
d9832f8d0b
3 changed files with 18 additions and 0 deletions
|
@ -342,6 +342,11 @@ void MainWidget::initialize_menubar(GUI::Window& window)
|
|||
view_menu.add_action(*m_zoom_in_action);
|
||||
view_menu.add_action(*m_zoom_out_action);
|
||||
view_menu.add_action(*m_reset_zoom_action);
|
||||
view_menu.add_action(GUI::Action::create(
|
||||
"&Fit Image To View", [&](auto&) {
|
||||
if (auto* editor = current_image_editor())
|
||||
editor->fit_image_to_view();
|
||||
}));
|
||||
view_menu.add_separator();
|
||||
view_menu.add_action(*m_add_guide_action);
|
||||
view_menu.add_action(*m_show_guides_action);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue