зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1400440 - Apply scroll shift for dynamic toolbar to the composited scroll offset right away. r=kats
MozReview-Commit-ID: 1I7C0lFx4WP --HG-- extra : rebase_source : 9c6ae39e10a2f9b86d2886140ee2e0d4f5cb4fda
This commit is contained in:
Родитель
0cc6f26617
Коммит
6ad906fc6d
|
@ -2999,10 +2999,14 @@ void AsyncPanZoomController::AdjustScrollForSurfaceShift(const ScreenPoint& aShi
|
|||
/ mFrameMetrics.GetZoom();
|
||||
APZC_LOG("%p adjusting scroll position by %s for surface shift\n",
|
||||
this, Stringify(adjustment).c_str());
|
||||
CSSPoint scrollOffset = mFrameMetrics.GetScrollOffset();
|
||||
scrollOffset.y = mY.ClampOriginToScrollableRect(scrollOffset.y + adjustment.y);
|
||||
scrollOffset.x = mX.ClampOriginToScrollableRect(scrollOffset.x + adjustment.x);
|
||||
mFrameMetrics.SetScrollOffset(scrollOffset);
|
||||
CSSRect scrollRange = mFrameMetrics.CalculateScrollRange();
|
||||
// Apply shift to mFrameMetrics.mScrollOffset.
|
||||
mFrameMetrics.SetScrollOffset(scrollRange.ClampPoint(
|
||||
mFrameMetrics.GetScrollOffset() + adjustment));
|
||||
// Apply shift to mCompositedScrollOffset, since the dynamic toolbar expects
|
||||
// the shift to take effect right away, without the usual frame delay.
|
||||
mCompositedScrollOffset = scrollRange.ClampPoint(
|
||||
mCompositedScrollOffset + adjustment);
|
||||
RequestContentRepaint();
|
||||
UpdateSharedCompositorFrameMetrics();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче