mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 07:13:20 +00:00
Bug 1352564 - Add a method to invert a Matrix4x4 if it's invertible. r=botond
Use it in HitTestingTreeNode::Untransform. MozReview-Commit-ID: 1JkLh99FD0h --HG-- extra : rebase_source : ca9836c1999a2af3cac5287a9efa875c415634f7
This commit is contained in:
parent
8a81f4a587
commit
9ebdb4f7f0
@ -1236,6 +1236,16 @@ public:
|
||||
return clone;
|
||||
}
|
||||
|
||||
Maybe<Matrix4x4Typed<TargetUnits, SourceUnits>> MaybeInverse() const
|
||||
{
|
||||
typedef Matrix4x4Typed<TargetUnits, SourceUnits> InvertedMatrix;
|
||||
InvertedMatrix clone = InvertedMatrix::FromUnknownMatrix(ToUnknownMatrix());
|
||||
if (clone.Invert()) {
|
||||
return Some(clone);
|
||||
}
|
||||
return Nothing();
|
||||
}
|
||||
|
||||
void Normalize()
|
||||
{
|
||||
for (int i = 0; i < 4; i++) {
|
||||
|
@ -255,7 +255,11 @@ HitTestingTreeNode::Untransform(const ParentLayerPoint& aPoint) const
|
||||
mApzc
|
||||
? mApzc->GetCurrentAsyncTransformWithOverscroll(AsyncPanZoomController::NORMAL)
|
||||
: AsyncTransformComponentMatrix());
|
||||
return UntransformBy(transform.Inverse(), aPoint);
|
||||
Maybe<ParentLayerToLayerMatrix4x4> inverse = transform.MaybeInverse();
|
||||
if (inverse) {
|
||||
return UntransformBy(inverse.ref(), aPoint);
|
||||
}
|
||||
return Nothing();
|
||||
}
|
||||
|
||||
HitTestResult
|
||||
|
Loading…
Reference in New Issue
Block a user