Bug 1164340. Fix up some scrollbar related comments in AsyncCompositionManager. r=botond

This commit is contained in:
Timothy Nikkel committed 2015-05-13 19:15:39 -05:00
1 parent d6b8f8b755
commit 134362212a
1 file changed
+4 -3
@@ -730,9 +730,7 @@ ApplyAsyncTransformToScrollbarForContent(Layer* aScrollbar,
// fraction of the whole srollable rect that is in view.
const float yScale = 1.f / asyncZoomY;
// Note: |metrics.GetZoom()| doesn't yet include the async zoom, so
// |metrics.CalculateCompositedSizeInCssPixels()| would not give a correct
// result.
// Note: |metrics.GetZoom()| doesn't yet include the async zoom.
const CSSToParentLayerScale effectiveZoom(metrics.GetZoom().yScale * asyncZoomY);
// Here we convert the scrollbar thumb ratio into a true unitless ratio by
@@ -740,6 +738,9 @@ ApplyAsyncTransformToScrollbarForContent(Layer* aScrollbar,
// to the scrollframe's space.
const float ratio = aScrollbar->GetScrollbarThumbRatio() /
(metrics.GetPresShellResolution() * asyncZoomY);
// The scroll thumb needs to be translated in opposite direction of the
// async scroll. This is because scrolling down, which translates the layer
// content up, should result in moving the scroll thumb down.
ParentLayerCoord yTranslation = -asyncScrollY * ratio;
// The scroll thumb additionally needs to be translated to compensate for