Bug 828249 - Fix fixed layer positioning when zoomed out beyond page bounds. r=kats
authorChris Lord <chrislord.net@gmail.com>
Thu, 10 Jan 2013 17:32:43 +0000
changeset 118440 934e8b48a5394b3de7b34e1e7fa60539cbd50088
parent 118439 f9ef215299560fe911e42d13f5280af2f236fad2
child 118441 1f3d5f4cc05cda0c371630c5e5df5ebca23af535
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerskats
bugs828249
milestone21.0a1
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.
gfx/layers/ipc/CompositorParent.cpp
--- 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(),