From 6c9f1c396ab420368fb5b82f32a6cdded0ad1850 Mon Sep 17 00:00:00 2001 From: MacDue Date: Thu, 17 Aug 2023 21:21:15 +0100 Subject: [PATCH] LibWeb: Don't use CSSPixels when resolving radial gradient color stops CSSPixels are not precise enough to resolve gradient positions, which leads to visual artifacts. --- Userland/Libraries/LibWeb/Painting/GradientPainting.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/Painting/GradientPainting.cpp b/Userland/Libraries/LibWeb/Painting/GradientPainting.cpp index b5fce68190..0a7999cafb 100644 --- a/Userland/Libraries/LibWeb/Painting/GradientPainting.cpp +++ b/Userland/Libraries/LibWeb/Painting/GradientPainting.cpp @@ -140,7 +140,7 @@ RadialGradientData resolve_radial_gradient_data(Layout::NodeWithStyleAndBoxModel // Start center, goes right to ending point, where the gradient line intersects the ending shape auto resolved_color_stops = resolve_color_stop_positions( node, radial_gradient.color_stop_list(), [&](auto const& length_percentage) { - return (length_percentage.to_px(node, gradient_size.width()) / gradient_size.width()).to_float(); + return length_percentage.to_px(node, gradient_size.width()).to_float() / gradient_size.width().to_float(); }, radial_gradient.is_repeating()); return { resolved_color_stops };