mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:57:34 +00:00
PixelPaint: Add point_position_to_preferred_cell to RectangleSelectTool
Specializing point_position_to_preferred_cell for the RectangleSelectTool as it selects a new cells with a rounding behavior instead of a flooring behavior
This commit is contained in:
parent
3d756e89c8
commit
7d544344ca
2 changed files with 6 additions and 0 deletions
|
@ -211,4 +211,9 @@ GUI::Widget* RectangleSelectTool::get_properties_widget()
|
||||||
return m_properties_widget.ptr();
|
return m_properties_widget.ptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Gfx::IntPoint RectangleSelectTool::point_position_to_preferred_cell(Gfx::FloatPoint const& position) const
|
||||||
|
{
|
||||||
|
return position.to_rounded<int>();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@ public:
|
||||||
virtual void on_second_paint(Layer const*, GUI::PaintEvent&) override;
|
virtual void on_second_paint(Layer const*, GUI::PaintEvent&) override;
|
||||||
virtual GUI::Widget* get_properties_widget() override;
|
virtual GUI::Widget* get_properties_widget() override;
|
||||||
virtual Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap>> cursor() override { return Gfx::StandardCursor::Crosshair; }
|
virtual Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap>> cursor() override { return Gfx::StandardCursor::Crosshair; }
|
||||||
|
virtual Gfx::IntPoint point_position_to_preferred_cell(Gfx::FloatPoint const& position) const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual StringView tool_name() const override { return "Rectangle Select Tool"sv; }
|
virtual StringView tool_name() const override { return "Rectangle Select Tool"sv; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue