Bug 607417 - Clamp the transform of fixed-position layers to work with RTL pages (interaction with bug 748384). r=ajuma

This commit is contained in:
Kartikaya Gupta 2012-05-29 10:22:49 -04:00
parent 893d53c11b
commit ff7dbddcd6

View File

@ -399,10 +399,12 @@ CompositorParent::TransformShadowTree()
// Alter the scroll offset so that fixed position layers remain within // Alter the scroll offset so that fixed position layers remain within
// the page area. // the page area.
int offsetX = NS_MAX(0, NS_MIN(mScrollOffset.x, mContentRect.width - mWidgetSize.width)); float offsetX = mScrollOffset.x / tempScaleDiffX;
int offsetY = NS_MAX(0, NS_MIN(mScrollOffset.y, mContentRect.height - mWidgetSize.height)); float offsetY = mScrollOffset.y / tempScaleDiffY;
gfxPoint reverseViewTranslation(offsetX / tempScaleDiffX - metricsScrollOffset.x, offsetX = NS_MAX((float)mContentRect.x, NS_MIN(offsetX, (float)(mContentRect.XMost() - mWidgetSize.width)));
offsetY / tempScaleDiffY - metricsScrollOffset.y); offsetY = NS_MAX((float)mContentRect.y, NS_MIN(offsetY, (float)(mContentRect.YMost() - mWidgetSize.height)));
gfxPoint reverseViewTranslation(offsetX - metricsScrollOffset.x,
offsetY - metricsScrollOffset.y);
TranslateFixedLayers(layer, reverseViewTranslation); TranslateFixedLayers(layer, reverseViewTranslation);
} }