LibWeb: Interpolate rect() function by computed value

This commit is contained in:
Tim Ledbetter 2025-09-13 14:05:31 +01:00 committed by Sam Atkins
commit 853bedeb31
Notes: github-actions[bot] 2025-09-15 09:36:19 +00:00
2 changed files with 29 additions and 20 deletions

View file

@ -1230,6 +1230,15 @@ static RefPtr<StyleValue const> interpolate_value_impl(DOM::Element& element, Ca
return {};
return Xywh { *interpolated_x, *interpolated_y, *interpolated_width, *interpolated_height };
},
[&](Rect const& from_rect) -> Optional<BasicShape> {
auto const& to_rect = to_shape.get<Rect>();
auto from_rect_box = from_rect.box;
auto to_rect_box = to_rect.box;
auto interpolated_rect_box = interpolate_length_box(calculation_context, from_rect_box, to_rect_box, delta);
if (!interpolated_rect_box.has_value())
return {};
return Rect { *interpolated_rect_box };
},
[](auto&) -> Optional<BasicShape> {
return {};
});