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

PixelPaint: Add point_position_to_preferred_cell method to Tool

This method is used to point a position at the preferred pixel of
the image. Certain tools may want to specify a different preferred
pixel for the same input position.
This commit is contained in:
Crax97 2022-08-29 22:48:35 +02:00 committed by Andreas Kling
parent 059a9c71a0
commit 3037f5b183

View file

@ -64,6 +64,7 @@ public:
virtual void on_tool_activation() { }
virtual GUI::Widget* get_properties_widget() { return nullptr; }
virtual Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap>> cursor() { return Gfx::StandardCursor::None; }
virtual Gfx::IntPoint point_position_to_preferred_cell(Gfx::FloatPoint const& position) const { return position.to_type<int>(); }
void clear() { m_editor = nullptr; }
void setup(ImageEditor&);