mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-16 13:09:41 +00:00
LibWeb: Interpolate rect()
function by computed value
This commit is contained in:
parent
0c89e86ff7
commit
853bedeb31
Notes:
github-actions[bot]
2025-09-15 09:36:19 +00:00
Author: https://github.com/tcl3
Commit: 853bedeb31
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6183
Reviewed-by: https://github.com/AtkinsSJ ✅
2 changed files with 29 additions and 20 deletions
|
@ -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 {};
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue