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

PixelPaint: Add Zoom Reset button to new View Menubar.

If you lose your image while panning and zooming around, it is handy to
have a reset function to get back home. :^)
This commit is contained in:
Jagger De Leo 2021-04-15 21:09:25 -04:00 committed by Linus Groh
parent 223472c57f
commit b48b8c372e
3 changed files with 18 additions and 0 deletions

View file

@ -393,6 +393,15 @@ void ImageEditor::scale_centered_on_position(const Gfx::IntPoint& position, floa
relayout();
}
void ImageEditor::reset_scale_and_position()
{
if (m_scale != 1.0f)
m_scale = 1.0f;
m_pan_origin = Gfx::FloatPoint(0, 0);
relayout();
}
void ImageEditor::relayout()
{
if (!image())