Bug 828249 - Fix fixed layer positioning when zoomed out beyond page bounds. r=kats
width/height parameters in CompositorParent got mixed up at some point.
--- a/gfx/layers/ipc/CompositorParent.cpp
+++ b/gfx/layers/ipc/CompositorParent.cpp
@@ -998,32 +998,32 @@ CompositorParent::TransformShadowTree(Ti
treeTransform = gfx3DMatrix(ViewTransform(-scrollCompensation,
gfxSize(mXScale, mYScale)));
// If the contents can fit entirely within the widget area on a particular
// dimenson, we need to translate and scale so that the fixed layers remain
// within the page boundaries.
if (mContentRect.width * tempScaleDiffX < metrics.mCompositionBounds.width) {
offset.x = -metricsScrollOffset.x;
- scaleDiff.height = NS_MIN(1.0f, metrics.mCompositionBounds.width / (float)mContentRect.width);
+ scaleDiff.width = NS_MIN(1.0f, metrics.mCompositionBounds.width / (float)mContentRect.width);
} else {
offset.x = clamped(mScrollOffset.x / tempScaleDiffX, (float)mContentRect.x,
mContentRect.XMost() - metrics.mCompositionBounds.width / tempScaleDiffX) -
metricsScrollOffset.x;
- scaleDiff.height = tempScaleDiffX;
+ scaleDiff.width = tempScaleDiffX;
}
if (mContentRect.height * tempScaleDiffY < metrics.mCompositionBounds.height) {
offset.y = -metricsScrollOffset.y;
- scaleDiff.width = NS_MIN(1.0f, metrics.mCompositionBounds.height / (float)mContentRect.height);
+ scaleDiff.height = NS_MIN(1.0f, metrics.mCompositionBounds.height / (float)mContentRect.height);
} else {
offset.y = clamped(mScrollOffset.y / tempScaleDiffY, (float)mContentRect.y,
mContentRect.YMost() - metrics.mCompositionBounds.height / tempScaleDiffY) -
metricsScrollOffset.y;
- scaleDiff.width = tempScaleDiffY;
+ scaleDiff.height = tempScaleDiffY;
}
// The transform already takes the resolution scale into account. Since we
// will apply the resolution scale again when computing the effective
// transform, we must apply the inverse resolution scale here.
gfx3DMatrix computedTransform = treeTransform * currentTransform;
computedTransform.Scale(1.0f/container->GetPreXScale(),
1.0f/container->GetPreYScale(),