diff options
author | Mustafa Quraish <mustafaq9@gmail.com> | 2021-09-11 23:14:15 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-12 17:14:57 +0200 |
commit | abefe2391d5eb31c728fcb716c7aeb2c3c988155 (patch) | |
tree | df3c9cfe3f3e126b18ee2c66cb326423c708afb6 /Userland/Applications/PixelPaint/ImageEditor.cpp | |
parent | 189066d91d62389c5f230f93aa0ccbb97a484a8f (diff) | |
download | serenity-abefe2391d5eb31c728fcb716c7aeb2c3c988155.zip |
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.
Diffstat (limited to 'Userland/Applications/PixelPaint/ImageEditor.cpp')
-rw-r--r-- | Userland/Applications/PixelPaint/ImageEditor.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Userland/Applications/PixelPaint/ImageEditor.cpp b/Userland/Applications/PixelPaint/ImageEditor.cpp index aad67cccc3..3d583ba5fe 100644 --- a/Userland/Applications/PixelPaint/ImageEditor.cpp +++ b/Userland/Applications/PixelPaint/ImageEditor.cpp @@ -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(); |