mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 607417 - Fix reverse translation of shadow layer clip rects. r=ajuma
When asynchronous scrolling happens and the translation is compensated for, this was incorrectly applied to the clip rects of shadow layers.
This commit is contained in:
parent
2e7d5e7487
commit
35ed48a106
@ -72,10 +72,10 @@ static void Scale(gfx3DMatrix& aTransform, double aXScale, double aYScale)
|
||||
aTransform._22 *= aYScale;
|
||||
}
|
||||
|
||||
static void ReverseTranslate(gfx3DMatrix& aTransform, ViewTransform& aViewTransform)
|
||||
static void ReverseTranslate(gfx3DMatrix& aTransform, const gfxPoint& aOffset)
|
||||
{
|
||||
aTransform._41 -= aViewTransform.mTranslation.x / aViewTransform.mXScale;
|
||||
aTransform._42 -= aViewTransform.mTranslation.y / aViewTransform.mYScale;
|
||||
aTransform._41 -= aOffset.x;
|
||||
aTransform._42 -= aOffset.y;
|
||||
}
|
||||
|
||||
|
||||
@ -278,11 +278,16 @@ TransformShadowTree(nsDisplayListBuilder* aBuilder, nsFrameLoader* aFrameLoader,
|
||||
|
||||
if (aLayer->GetIsFixedPosition() &&
|
||||
!aLayer->GetParent()->GetIsFixedPosition()) {
|
||||
ReverseTranslate(shadowTransform, layerTransform);
|
||||
// Alter the shadow transform of fixed position layers in the situation
|
||||
// that the view transform's scroll position doesn't match the actual
|
||||
// scroll position, due to asynchronous layer scrolling.
|
||||
float offsetX = layerTransform.mTranslation.x / layerTransform.mXScale;
|
||||
float offsetY = layerTransform.mTranslation.y / layerTransform.mYScale;
|
||||
ReverseTranslate(shadowTransform, gfxPoint(offsetX, offsetY));
|
||||
const nsIntRect* clipRect = shadow->GetShadowClipRect();
|
||||
if (clipRect) {
|
||||
nsIntRect transformedClipRect(*clipRect);
|
||||
transformedClipRect.MoveBy(shadowTransform._41, shadowTransform._42);
|
||||
transformedClipRect.MoveBy(-offsetX, -offsetY);
|
||||
shadow->SetShadowClipRect(&transformedClipRect);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user