LibWeb: Simplify generation of perspective() matrix transform

A value of `perspective(none)` should result in the identity matrix. But
instead of creating that identity matrix explicitly, just break and
default to the identity matrix at the bottom of this method.
This commit is contained in:
Jelle Raaijmakers 2025-11-18 00:21:58 +01:00 committed by Jelle Raaijmakers
parent e4dc2663ba
commit 15fa6676b0
Notes: github-actions[bot] 2025-11-18 13:37:37 +00:00

View file

@ -90,10 +90,7 @@ ErrorOr<Gfx::FloatMatrix4x4> Transformation::to_matrix(Optional<Painting::Painta
0, 0, 1, 0,
0, 0, -1 / distance, 1);
}
return Gfx::FloatMatrix4x4(1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1);
break;
case CSS::TransformFunction::Matrix:
if (count == 6)
return Gfx::FloatMatrix4x4(TRY(value(0)), TRY(value(2)), 0, TRY(value(4)),