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

LibGUI: Add drawing triangle from coordinate list

This commit is contained in:
FrHun 2022-06-13 20:03:09 +02:00 committed by Sam Atkins
parent dafea57fe2
commit b3d1fa4c54
2 changed files with 7 additions and 0 deletions

View file

@ -671,6 +671,12 @@ void Painter::draw_bitmap(IntPoint const& p, GlyphBitmap const& bitmap, Color co
}
}
void Painter::draw_triangle(IntPoint const& offset, Span<IntPoint const> control_points, Color color)
{
VERIFY(control_points.size() == 3);
draw_triangle(control_points[0] + offset, control_points[1] + offset, control_points[2] + offset, color);
}
void Painter::draw_triangle(IntPoint const& a, IntPoint const& b, IntPoint const& c, Color color)
{
IntPoint p0(to_physical(a));