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

LibGfx: Add int overloads for (AntiAliasing)Painter float methods

Without this change, the upcoming LibWeb pixel types will require a
silly doubled conversion in some places.

eg: `some_rect.to_type<int>().to_type<float>()`

With these overloads, we can get away with `some_rect.to_type<int>()`.
This commit is contained in:
Sam Atkins 2022-12-07 20:50:34 +00:00 committed by Sam Atkins
parent d2334957ba
commit 83f31cb4a7
4 changed files with 13 additions and 1 deletions

View file

@ -201,6 +201,11 @@ void AntiAliasingPainter::draw_dotted_line(IntPoint point1, IntPoint point2, Col
}
}
void AntiAliasingPainter::draw_line(IntPoint actual_from, IntPoint actual_to, Color color, float thickness, Painter::LineStyle style, Color alternate_color, LineLengthMode line_length_mode)
{
draw_line(actual_from.to_type<float>(), actual_to.to_type<float>(), color, thickness, style, alternate_color, line_length_mode);
}
void AntiAliasingPainter::draw_line(FloatPoint actual_from, FloatPoint actual_to, Color color, float thickness, Painter::LineStyle style, Color alternate_color, LineLengthMode line_length_mode)
{
if (style == Painter::LineStyle::Dotted)