summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
diff options
context:
space:
mode:
authorMacDue <macdue@dueutil.tech>2023-01-05 17:02:43 +0000
committerLinus Groh <mail@linusgroh.de>2023-01-05 19:56:43 +0100
commit93737a4b00ce3d4731b53d74a1a1a581f5277c34 (patch)
tree4115dd6638c679dd9a8f561d253a1563096011f4 /Userland/Libraries/LibWeb
parent33b6ac03060ab6cae2ba6988ac1a234a7caeebe8 (diff)
downloadserenity-93737a4b00ce3d4731b53d74a1a1a581f5277c34.zip
LibWeb: Return floats from color stop resolution functions
These don't deal with pixels so should not return CSSPixels. This removes one suspicious looking cast.
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r--Userland/Libraries/LibWeb/Painting/GradientPainting.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/Painting/GradientPainting.cpp b/Userland/Libraries/LibWeb/Painting/GradientPainting.cpp
index 91e640eb64..6f0407f84d 100644
--- a/Userland/Libraries/LibWeb/Painting/GradientPainting.cpp
+++ b/Userland/Libraries/LibWeb/Painting/GradientPainting.cpp
@@ -66,7 +66,7 @@ static ColorStopData resolve_color_stop_positions(auto const& color_stop_list, a
// or transition hint before it.
auto max_previous_color_stop_or_hint = resolved_color_stops[0].position;
auto resolve_stop_position = [&](auto& position) {
- float value = static_cast<float>(resolve_position_to_float(position));
+ float value = resolve_position_to_float(position);
value = max(value, max_previous_color_stop_or_hint);
max_previous_color_stop_or_hint = value;
return value;
@@ -138,7 +138,7 @@ LinearGradientData resolve_linear_gradient_data(Layout::Node const& node, CSSPix
auto resolved_color_stops = resolve_color_stop_positions(
linear_gradient.color_stop_list(), [&](auto const& length_percentage) {
- return length_percentage.resolved(node, gradient_length).to_px(node) / gradient_length_px;
+ return length_percentage.resolved(node, gradient_length).to_px(node).value() / gradient_length_px;
},
linear_gradient.is_repeating());
@@ -162,7 +162,7 @@ RadialGradientData resolve_radial_gradient_data(Layout::Node const& node, CSSPix
auto gradient_length = CSS::Length::make_px(gradient_size.width());
auto resolved_color_stops = resolve_color_stop_positions(
radial_gradient.color_stop_list(), [&](auto const& length_percentage) {
- return length_percentage.resolved(node, gradient_length).to_px(node) / gradient_size.width().value();
+ return (length_percentage.resolved(node, gradient_length).to_px(node) / gradient_size.width()).value();
},
radial_gradient.is_repeating());
return { resolved_color_stops };