mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:37:35 +00:00
LibGfx: Increase bezier splitting tolerance to 0.5
No noticeable difference a bit faster. This is still arbitrary and should be somehow derived from the curve.
This commit is contained in:
parent
65b87bace9
commit
13a4fb0325
11 changed files with 8 additions and 5 deletions
|
@ -514,9 +514,10 @@ Path Path::stroke_to_fill(float thickness) const
|
|||
}
|
||||
|
||||
// Note: This is the same as the tolerance from bezier curve splitting.
|
||||
constexpr auto flatness = 0.015f;
|
||||
auto pen_vertex_count = max(
|
||||
static_cast<int>(ceilf(AK::Pi<float> / acosf(1 - (2 * flatness) / thickness))), 4);
|
||||
constexpr auto flatness = 0.5f;
|
||||
auto pen_vertex_count = (thickness >= 2 * flatness) ? max(
|
||||
static_cast<int>(ceilf(AK::Pi<float> / acosf(1 - (2 * flatness) / thickness))), 4)
|
||||
: 4;
|
||||
if (pen_vertex_count % 2 == 1)
|
||||
pen_vertex_count += 1;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue