mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-21 02:08:12 +03:00
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:
parent
189066d91d
commit
abefe2391d
Notes:
sideshowbarker
2024-07-18 04:07:54 +09:00
Author: https://github.com/mustafaquraish Commit: https://github.com/SerenityOS/serenity/commit/abefe2391d5 Pull-request: https://github.com/SerenityOS/serenity/pull/9982
@ -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()
|
void ImageEditor::fit_image_to_view()
|
||||||
{
|
{
|
||||||
auto viewport_rect = rect();
|
auto viewport_rect = rect();
|
||||||
|
@ -58,6 +58,9 @@ public:
|
|||||||
void reset_scale_and_position();
|
void reset_scale_and_position();
|
||||||
void scale_by(float);
|
void scale_by(float);
|
||||||
|
|
||||||
|
void set_pan_origin(Gfx::FloatPoint const&);
|
||||||
|
Gfx::FloatPoint pan_origin() const { return m_pan_origin; }
|
||||||
|
|
||||||
Color primary_color() const { return m_primary_color; }
|
Color primary_color() const { return m_primary_color; }
|
||||||
void set_primary_color(Color);
|
void set_primary_color(Color);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user