1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:37:36 +00:00

LibWeb: Calculate to <corner> angles for linear-gradients

This also renames LinearGradientStyleValue::angle() to
LinearGradientStyleValue::angle_degrees() to make the unit more
obvious.
This commit is contained in:
MacDue 2022-07-17 19:45:38 +01:00 committed by Linus Groh
parent 9e06fe4b3f
commit 4246d04e5a
3 changed files with 15 additions and 6 deletions

View file

@ -27,7 +27,7 @@ static Optional<GfxGradient> linear_gradient_to_gfx_gradient(CSS::LinearGradient
if (linear_gradient.color_stop_list().size() != 2)
return {};
auto angle = round_to<int>(linear_gradient.angle(background_rect));
auto angle = round_to<int>(linear_gradient.angle_degrees(background_rect));
auto color_a = linear_gradient.color_stop_list()[0].color_stop.color;
auto color_b = linear_gradient.color_stop_list()[1].color_stop.color;
auto orientation = [&]() -> Optional<Gfx::Orientation> {