mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-05 09:06:08 +00:00
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.
This commit is contained in:
parent
0e78037c68
commit
d9c842a83f
Notes:
sideshowbarker
2024-07-18 03:35:30 +09:00
Author: https://github.com/Zaggy1024
Commit: d9c842a83f
Pull-request: https://github.com/SerenityOS/serenity/pull/20898
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/Hendiadyoin1
Reviewed-by: https://github.com/MacDue
Reviewed-by: https://github.com/kalenikaliaksandr ✅
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue