Skip to content

Commit 15fa667

Browse files
committed
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.
1 parent e4dc266 commit 15fa667

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Libraries/LibWeb/CSS/Transformation.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,7 @@ ErrorOr<Gfx::FloatMatrix4x4> Transformation::to_matrix(Optional<Painting::Painta
9090
0, 0, 1, 0,
9191
0, 0, -1 / distance, 1);
9292
}
93-
return Gfx::FloatMatrix4x4(1, 0, 0, 0,
94-
0, 1, 0, 0,
95-
0, 0, 1, 0,
96-
0, 0, 0, 1);
93+
break;
9794
case CSS::TransformFunction::Matrix:
9895
if (count == 6)
9996
return Gfx::FloatMatrix4x4(TRY(value(0)), TRY(value(2)), 0, TRY(value(4)),

0 commit comments

Comments
 (0)