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.
This commit is contained in:
Chris Lord 2013-01-10 17:32:43 +00:00
parent d0161b544c
commit 3c6477ca95

View File

@ -1003,22 +1003,22 @@ CompositorParent::TransformShadowTree(TimeStamp aCurrentFrame)
// 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