Ignore all translations in Matrix::TransformDirection (flutter/engine#35854)
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user