mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:17:44 +00:00
LibGUI: Add drawing triangle from coordinate list
This commit is contained in:
parent
dafea57fe2
commit
b3d1fa4c54
2 changed files with 7 additions and 0 deletions
|
@ -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)
|
void Painter::draw_triangle(IntPoint const& a, IntPoint const& b, IntPoint const& c, Color color)
|
||||||
{
|
{
|
||||||
IntPoint p0(to_physical(a));
|
IntPoint p0(to_physical(a));
|
||||||
|
|
|
@ -57,6 +57,7 @@ public:
|
||||||
void draw_scaled_bitmap(IntRect const& dst_rect, Gfx::Bitmap const&, IntRect const& src_rect, float opacity = 1.0f, ScalingMode = ScalingMode::NearestNeighbor);
|
void draw_scaled_bitmap(IntRect const& dst_rect, Gfx::Bitmap const&, IntRect const& src_rect, float opacity = 1.0f, ScalingMode = ScalingMode::NearestNeighbor);
|
||||||
void draw_scaled_bitmap(IntRect const& dst_rect, Gfx::Bitmap const&, FloatRect const& src_rect, float opacity = 1.0f, ScalingMode = ScalingMode::NearestNeighbor);
|
void draw_scaled_bitmap(IntRect const& dst_rect, Gfx::Bitmap const&, FloatRect const& src_rect, float opacity = 1.0f, ScalingMode = ScalingMode::NearestNeighbor);
|
||||||
void draw_triangle(IntPoint const&, IntPoint const&, IntPoint const&, Color);
|
void draw_triangle(IntPoint const&, IntPoint const&, IntPoint const&, Color);
|
||||||
|
void draw_triangle(IntPoint const& offset, Span<IntPoint const>, Color);
|
||||||
void draw_ellipse_intersecting(IntRect const&, Color, int thickness = 1);
|
void draw_ellipse_intersecting(IntRect const&, Color, int thickness = 1);
|
||||||
void set_pixel(IntPoint const&, Color, bool blend = false);
|
void set_pixel(IntPoint const&, Color, bool blend = false);
|
||||||
void set_pixel(int x, int y, Color color, bool blend = false) { set_pixel({ x, y }, color, blend); }
|
void set_pixel(int x, int y, Color color, bool blend = false) { set_pixel({ x, y }, color, blend); }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue