LibWeb: Clamp calculated cubic-bezier() X coords using normal system

Previously we were doing this ad-hoc later in the process but we now
have the `calc` clamping system which can simplify things
This commit is contained in:
Callum Law 2025-10-10 00:59:59 +13:00 committed by Sam Atkins
commit 06a57a280d
Notes: github-actions[bot] 2025-10-20 10:29:21 +00:00
4 changed files with 11 additions and 15 deletions

View file

@ -312,9 +312,9 @@ EasingFunction EasingFunction::from_style_value(StyleValue const& style_value)
return LinearEasingFunction { resolved_control_points, linear.to_string(SerializationMode::ResolvedValue) };
},
[](EasingStyleValue::CubicBezier const& cubic_bezier) -> EasingFunction {
auto resolved_x1 = clamp(cubic_bezier.x1.resolved({}).value_or(0.0), 0.0, 1.0);
auto resolved_x1 = cubic_bezier.x1.resolved({}).value_or(0.0);
auto resolved_y1 = cubic_bezier.y1.resolved({}).value_or(0.0);
auto resolved_x2 = clamp(cubic_bezier.x2.resolved({}).value_or(0.0), 0.0, 1.0);
auto resolved_x2 = cubic_bezier.x2.resolved({}).value_or(0.0);
auto resolved_y2 = cubic_bezier.y2.resolved({}).value_or(0.0);
return CubicBezierEasingFunction { resolved_x1, resolved_y1, resolved_x2, resolved_y2, cubic_bezier.to_string(SerializationMode::Normal) };