1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:37:46 +00:00

LibGfx: Apply translation and scale to Painter::draw_triangle()

This commit is contained in:
David Isaksson 2021-09-05 12:25:02 +02:00 committed by Andreas Kling
parent e56764bd74
commit 242acfcbae

View file

@ -668,11 +668,9 @@ void Painter::draw_bitmap(const IntPoint& p, const GlyphBitmap& bitmap, Color co
void Painter::draw_triangle(const IntPoint& a, const IntPoint& b, const IntPoint& c, Color color) void Painter::draw_triangle(const IntPoint& a, const IntPoint& b, const IntPoint& c, Color color)
{ {
VERIFY(scale() == 1); // FIXME: Add scaling support. IntPoint p0(to_physical(a));
IntPoint p1(to_physical(b));
IntPoint p0(a); IntPoint p2(to_physical(c));
IntPoint p1(b);
IntPoint p2(c);
// sort points from top to bottom // sort points from top to bottom
if (p0.y() > p1.y()) if (p0.y() > p1.y())