mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-22 16:09:23 +00:00
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:
parent
ef4f01ea44
commit
06a57a280d
Notes:
github-actions[bot]
2025-10-20 10:29:21 +00:00
Author: https://github.com/Calme1709
Commit: 06a57a280d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6459
Reviewed-by: https://github.com/AtkinsSJ ✅
4 changed files with 11 additions and 15 deletions
|
|
@ -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) };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue