mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 08:37:35 +00:00
LibGfx: Add Path::stroke_to_fill(thickness)
This function generates a new path, which can be filled to rasterize a stroke of the original path (at whatever thickness you like). It does this by convolving a circular pen with the path, so right now only supports round line caps. Since filled paths now have good antialiasing, doing this results in good stroked paths for "free". It also (for free) fixes stroked lines with an opacity < 1, nice line joins, and is possible to fill with a paint style (e.g. a gradient or an image). Algorithm from: https://keithp.com/~keithp/talks/cairo2003.pdf
This commit is contained in:
parent
c50ce2030d
commit
95a07bd4e5
2 changed files with 162 additions and 0 deletions
|
@ -248,6 +248,8 @@ public:
|
|||
|
||||
DeprecatedString to_deprecated_string() const;
|
||||
|
||||
Path stroke_to_fill(float thickness) const;
|
||||
|
||||
private:
|
||||
void invalidate_split_lines()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue