mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 695832 - Perpsective origin offset should be relative to the transform origin. r=roc
This commit is contained in:
parent
8d8eabc208
commit
42dcd2e02c
@ -2483,13 +2483,6 @@ gfxPoint3D GetDeltaToMozPerspectiveOrigin(const nsIFrame* aFrame,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An offset of (0,0) results in the perspective-origin being at the centre of the element,
|
||||
* so include a shift of the centre point to (0,0).
|
||||
*/
|
||||
result.x -= NSAppUnitsToFloatPixels(boundingRect.width, aFactor)/2;
|
||||
result.y -= NSAppUnitsToFloatPixels(boundingRect.height, aFactor)/2;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -2551,7 +2544,10 @@ nsDisplayTransform::GetResultingTransformMatrix(const nsIFrame* aFrame,
|
||||
perspective._34 =
|
||||
-1.0 / NSAppUnitsToFloatPixels(parentDisp->mChildPerspective.GetCoordValue(),
|
||||
aFactor);
|
||||
result = result * nsLayoutUtils::ChangeMatrixBasis(toPerspectiveOrigin, perspective);
|
||||
/* At the point when perspective is applied, we have been translated to the transform origin.
|
||||
* The translation to the perspective origin is the difference between these values.
|
||||
*/
|
||||
result = result * nsLayoutUtils::ChangeMatrixBasis(toPerspectiveOrigin - toMozOrigin, perspective);
|
||||
}
|
||||
|
||||
if (aFrame->Preserves3D() && nsLayoutUtils::Are3DTransformsEnabled()) {
|
||||
|
Loading…
Reference in New Issue
Block a user