PixelPaint: Add setter/getter for ImageEditor::m_pan_origin

This allows us to use tools to change the panned position, since
right now this is only accessible internally to the editor.
This commit is contained in:
Mustafa Quraish 2021-09-11 23:14:15 -04:00 committed by Andreas Kling
commit abefe2391d
Notes: sideshowbarker 2024-07-18 04:07:54 +09:00
2 changed files with 12 additions and 0 deletions

View file

@ -568,6 +568,15 @@ void ImageEditor::scale_by(float scale_delta)
}
}
void ImageEditor::set_pan_origin(Gfx::FloatPoint const& pan_origin)
{
if (m_pan_origin == pan_origin)
return;
m_pan_origin = pan_origin;
relayout();
}
void ImageEditor::fit_image_to_view()
{
auto viewport_rect = rect();