diff --git a/Tests/LibWeb/Ref/reference/images/border-radius-ref.png b/Tests/LibWeb/Ref/reference/images/border-radius-ref.png index 3531dfd70ba8218aa2ba2e1ed5891ff889794e45..4d80cf5da158b8ca04c474af778cfe094d886a6a 100644 Binary files a/Tests/LibWeb/Ref/reference/images/border-radius-ref.png and b/Tests/LibWeb/Ref/reference/images/border-radius-ref.png differ diff --git a/Tests/LibWeb/Ref/reference/images/canvas-path-rect-ref.png b/Tests/LibWeb/Ref/reference/images/canvas-path-rect-ref.png index efe2a7dc93269b155d27aa5cde04963a5efa1562..2d490ac6a667e3a3c637b1cf42d6e371241e5e49 100644 Binary files a/Tests/LibWeb/Ref/reference/images/canvas-path-rect-ref.png and b/Tests/LibWeb/Ref/reference/images/canvas-path-rect-ref.png differ diff --git a/Tests/LibWeb/Ref/reference/images/css-backgrounds-ref.png b/Tests/LibWeb/Ref/reference/images/css-backgrounds-ref.png index 7d0e69ddadf1741d2b572000e8afb36f903c296c..b1689dd5e99124b4087ce340a267ceecab23b549 100644 Binary files a/Tests/LibWeb/Ref/reference/images/css-backgrounds-ref.png and b/Tests/LibWeb/Ref/reference/images/css-backgrounds-ref.png differ diff --git a/Tests/LibWeb/Ref/reference/images/inline-node-ref.png b/Tests/LibWeb/Ref/reference/images/inline-node-ref.png index 86457f7f68802602787c3140a668bb5ea6d912fc..1c791ec3ff680c2edb89b47adec1b218a063f867 100644 Binary files a/Tests/LibWeb/Ref/reference/images/inline-node-ref.png and b/Tests/LibWeb/Ref/reference/images/inline-node-ref.png differ diff --git a/Tests/LibWeb/Ref/reference/images/object-fit-position.png b/Tests/LibWeb/Ref/reference/images/object-fit-position.png index 4330aad35de18fd618c711b1ecc5ab30245d36fa..1dfd5789a186ec5b292108733572d4638f043028 100644 Binary files a/Tests/LibWeb/Ref/reference/images/object-fit-position.png and b/Tests/LibWeb/Ref/reference/images/object-fit-position.png differ diff --git a/Tests/LibWeb/Ref/reference/images/outer-box-shadow-ref.png b/Tests/LibWeb/Ref/reference/images/outer-box-shadow-ref.png index 6e477a0ac953ef6425d1a770f56b66132c1175da..b68e17ef6972c7f70586f314c0382f17691fe991 100644 Binary files a/Tests/LibWeb/Ref/reference/images/outer-box-shadow-ref.png and b/Tests/LibWeb/Ref/reference/images/outer-box-shadow-ref.png differ diff --git a/Tests/LibWeb/Ref/reference/images/svg-background-no-natural-size-ref.png b/Tests/LibWeb/Ref/reference/images/svg-background-no-natural-size-ref.png index 56cb7f3f46f5a184a5a539779972b021db19bf53..1cca4813f478c6ea6d870b53ab706ac787e50238 100644 Binary files a/Tests/LibWeb/Ref/reference/images/svg-background-no-natural-size-ref.png and b/Tests/LibWeb/Ref/reference/images/svg-background-no-natural-size-ref.png differ diff --git a/Tests/LibWeb/Ref/reference/images/svg-textPath-ref.png b/Tests/LibWeb/Ref/reference/images/svg-textPath-ref.png index c35dd031c0c31832c5320566a7ef162f8f3b76af..b75ea07b43c145a903410087dd5fd95f7b35618d 100644 Binary files a/Tests/LibWeb/Ref/reference/images/svg-textPath-ref.png and b/Tests/LibWeb/Ref/reference/images/svg-textPath-ref.png differ diff --git a/Tests/LibWeb/Ref/reference/images/text-shadow-ref.png b/Tests/LibWeb/Ref/reference/images/text-shadow-ref.png index 5900ae81610563733a89d030730e9ddcf3f78bd0..5c1c6881f2f5b61d6d11c79b89ce882f24bedd9c 100644 Binary files a/Tests/LibWeb/Ref/reference/images/text-shadow-ref.png and b/Tests/LibWeb/Ref/reference/images/text-shadow-ref.png differ diff --git a/Userland/Libraries/LibGfx/Painter.cpp b/Userland/Libraries/LibGfx/Painter.cpp index 3109f958536824308028efc25fcac0da7fb39bf9..da1caf9139e814743fde86bd9d2b5eaaed52f425 100644 --- a/Userland/Libraries/LibGfx/Painter.cpp +++ b/Userland/Libraries/LibGfx/Painter.cpp @@ -2086,7 +2086,8 @@ void Painter::draw_triangle_wave(IntPoint a_p1, IntPoint a_p2, Color color, int static bool can_approximate_bezier_curve(FloatPoint p1, FloatPoint p2, FloatPoint control) { - constexpr float tolerance = 0.015f; + // TODO: Somehow calculate the required number of splits based on the curve (and its size). + constexpr float tolerance = 0.5f; auto p1x = 3 * control.x() - 2 * p1.x() - p2.x(); auto p1y = 3 * control.y() - 2 * p1.y() - p2.y(); @@ -2163,7 +2164,8 @@ void Painter::for_each_line_segment_on_cubic_bezier_curve(FloatPoint control_poi static bool can_approximate_cubic_bezier_curve(FloatPoint p1, FloatPoint p2, FloatPoint control_0, FloatPoint control_1) { - constexpr float tolerance = 0.015f; + // TODO: Somehow calculate the required number of splits based on the curve (and its size). + constexpr float tolerance = 0.5f; auto ax = 3 * control_0.x() - 2 * p1.x() - p2.x(); auto ay = 3 * control_0.y() - 2 * p1.y() - p2.y(); diff --git a/Userland/Libraries/LibGfx/Path.cpp b/Userland/Libraries/LibGfx/Path.cpp index fd22ec195b92bcd7efc6fe16661bf9009a5a8108..a4fdac63192a4364c1c0fb4af3b46bc2f0eb6f4f 100644 --- a/Userland/Libraries/LibGfx/Path.cpp +++ b/Userland/Libraries/LibGfx/Path.cpp @@ -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(ceilf(AK::Pi / acosf(1 - (2 * flatness) / thickness))), 4); + constexpr auto flatness = 0.5f; + auto pen_vertex_count = (thickness >= 2 * flatness) ? max( + static_cast(ceilf(AK::Pi / acosf(1 - (2 * flatness) / thickness))), 4) + : 4; if (pen_vertex_count % 2 == 1) pen_vertex_count += 1;