1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:17:36 +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:
Crax97 2022-08-29 22:59:19 +02:00 committed by Andreas Kling
parent 3d756e89c8
commit 7d544344ca
2 changed files with 6 additions and 0 deletions

View file

@ -211,4 +211,9 @@ GUI::Widget* RectangleSelectTool::get_properties_widget()
return m_properties_widget.ptr();
}
Gfx::IntPoint RectangleSelectTool::point_position_to_preferred_cell(Gfx::FloatPoint const& position) const
{
return position.to_rounded<int>();
}
}