diff --git a/impeller/geometry/geometry_unittests.cc b/impeller/geometry/geometry_unittests.cc index 0957acf76b23a..c1c92f37e500f 100644 --- a/impeller/geometry/geometry_unittests.cc +++ b/impeller/geometry/geometry_unittests.cc @@ -229,7 +229,7 @@ TEST(GeometryTest, MatrixTransformDirection) { } { - auto matrix = Matrix::MakeTranslation({100, 100, 100}) * + auto matrix = Matrix::MakeTranslation({0, -0.4, 100}) * Matrix::MakeRotationZ(Radians{kPiOver2}) * Matrix::MakeScale({2.0, 2.0, 2.0}); auto vector = Point(10, 20); diff --git a/impeller/geometry/matrix.h b/impeller/geometry/matrix.h index 29bbb949b3918..9be6707f08503 100644 --- a/impeller/geometry/matrix.h +++ b/impeller/geometry/matrix.h @@ -249,7 +249,7 @@ struct Matrix { } constexpr Scalar GetDirectionScale(Vector3 direction) const { - return 1.0 / (this->Invert() * direction.Normalize()).Length() * + return 1.0 / (this->Basis().Invert() * direction.Normalize()).Length() * direction.Length(); }