From d9c842a83fdbc982fa9fc1e482d4957c65011677 Mon Sep 17 00:00:00 2001 From: Zaggy1024 Date: Fri, 1 Sep 2023 17:23:28 -0500 Subject: [PATCH] LibWeb: Set radial gradients' ending shape corners correctly Previously, the corner was always set to the top right, except if the top left turned out to be closest, in which case it would be left default-initialized instead. --- .../LibWeb/CSS/StyleValues/RadialGradientStyleValue.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/RadialGradientStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/RadialGradientStyleValue.cpp index 5040a6d482..dd71ca2d77 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/RadialGradientStyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/RadialGradientStyleValue.cpp @@ -85,16 +85,17 @@ Gfx::FloatSize RadialGradientStyleValue::resolve_size(Layout::Node const& node, auto bottom_right_distance = size.bottom_right().distance_from(center); auto bottom_left_distance = size.bottom_left().distance_from(center); auto distance = top_left_distance; + corner = size.top_left(); if (distance_compare(top_right_distance, distance)) { corner = size.top_right(); distance = top_right_distance; } if (distance_compare(bottom_right_distance, distance)) { - corner = size.top_right(); + corner = size.bottom_right(); distance = bottom_right_distance; } if (distance_compare(bottom_left_distance, distance)) { - corner = size.top_right(); + corner = size.bottom_left(); distance = bottom_left_distance; } return distance;