1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 04:47:34 +00:00

LibGfx: Add draw_line_for_path() and remove AntiAliasPolicy

draw_line_for_path() is the same as the standard antialiased
draw_line() but with a few few small hacks to improve the look of
paths.

AntiAliasPolicy is also removed as it's now unused.
This commit is contained in:
MacDue 2022-11-24 19:02:00 +01:00 committed by Andreas Kling
parent f7a680f30a
commit 76de41c3b7
3 changed files with 27 additions and 22 deletions

View file

@ -20,7 +20,7 @@ public:
}
void draw_line(FloatPoint const&, FloatPoint const&, Color, float thickness = 1, Painter::LineStyle style = Painter::LineStyle::Solid, Color alternate_color = Color::Transparent);
void draw_aliased_line(FloatPoint const&, FloatPoint const&, Color, float thickness = 1, Painter::LineStyle style = Painter::LineStyle::Solid, Color alternate_color = Color::Transparent);
void draw_line_for_path(FloatPoint const&, FloatPoint const&, Color, float thickness = 1, Painter::LineStyle style = Painter::LineStyle::Solid, Color alternate_color = Color::Transparent);
void fill_path(Path&, Color, Painter::WindingRule rule = Painter::WindingRule::Nonzero);
void stroke_path(Path const&, Color, float thickness);
void draw_quadratic_bezier_curve(FloatPoint const& control_point, FloatPoint const&, FloatPoint const&, Color, float thickness = 1, Painter::LineStyle style = Painter::LineStyle::Solid);
@ -77,11 +77,11 @@ private:
void draw_dotted_line(IntPoint, IntPoint, Gfx::Color, int thickness);
enum class AntiAliasPolicy {
OnlyEnds,
Full,
enum class FixmeEnableHacksForBetterPathPainting {
Yes,
No,
};
template<AntiAliasPolicy policy>
template<FixmeEnableHacksForBetterPathPainting path_hacks>
void draw_anti_aliased_line(FloatPoint, FloatPoint, Color, float thickness, Painter::LineStyle style, Color alternate_color);
void stroke_segment_intersection(FloatPoint const& current_line_a, FloatPoint const& current_line_b, FloatLine const& previous_line, Color, float thickness);
FloatQuad build_rotated_rectangle(FloatPoint const& direction, float width);