LibWeb: Support individual translate CSS property

This commit is contained in:
Andreas Kling 2024-11-22 16:42:20 +01:00 committed by Andreas Kling
commit 66a821e731
Notes: github-actions[bot] 2024-11-22 19:07:48 +00:00
22 changed files with 267 additions and 80 deletions

View file

@ -1128,9 +1128,12 @@ void PaintableBox::resolve_paint_properties()
set_box_shadow_data(move(resolved_box_shadow_data));
auto const& transformations = computed_values.transformations();
auto const& translate = computed_values.translate();
auto const& rotate = computed_values.rotate();
if (!transformations.is_empty() || rotate.has_value()) {
if (!transformations.is_empty() || translate.has_value() || rotate.has_value()) {
auto matrix = Gfx::FloatMatrix4x4::identity();
if (translate.has_value())
matrix = matrix * translate->to_matrix(*this).release_value();
if (rotate.has_value())
matrix = matrix * rotate->to_matrix(*this).release_value();
for (auto const& transform : transformations)