Ignore all translations in Matrix::TransformDirection (flutter/engine#35854)

This commit is contained in:
Brandon DeRosier
2022-08-31 19:31:24 -07:00
committed by GitHub
parent 4e2dd25090
commit 7413e4ffd3
2 changed files with 2 additions and 2 deletions

View File

@@ -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);

View File

@@ -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();
}