mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibWeb: Fix CSS transform invalidation when transitioning to none
Fixes https://github.com/LadybirdBrowser/ladybird/issues/2707
This commit is contained in:
parent
a9e20cb6c3
commit
9e287465b9
Notes:
github-actions[bot]
2025-03-15 12:31:38 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 9e287465b9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3953
3 changed files with 34 additions and 12 deletions
|
@ -1300,18 +1300,16 @@ void PaintableBox::resolve_paint_properties()
|
|||
auto const& translate = computed_values.translate();
|
||||
auto const& rotate = computed_values.rotate();
|
||||
auto const& scale = computed_values.scale();
|
||||
if (!transformations.is_empty() || translate.has_value() || rotate.has_value() || scale.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();
|
||||
if (scale.has_value())
|
||||
matrix = matrix * scale->to_matrix(*this).release_value();
|
||||
for (auto const& transform : transformations)
|
||||
matrix = matrix * transform.to_matrix(*this).release_value();
|
||||
set_transform(matrix);
|
||||
}
|
||||
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();
|
||||
if (scale.has_value())
|
||||
matrix = matrix * scale->to_matrix(*this).release_value();
|
||||
for (auto const& transform : transformations)
|
||||
matrix = matrix * transform.to_matrix(*this).release_value();
|
||||
set_transform(matrix);
|
||||
|
||||
auto const& transform_origin = computed_values.transform_origin();
|
||||
auto reference_box = transform_box_rect();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue