Bug 1662014 - Stop using the mSmoothScrollOffset field. r=botond

This is the only place that uses the mSmoothScrollOffset any more, and it
doesn't really need to as a local variable suffices.

Differential Revision: https://phabricator.services.mozilla.com/D88748
This commit is contained in:
Kartikaya Gupta 2020-09-12 13:06:30 +00:00
Родитель 80742a3694
Коммит 03e7bbc347
1 изменённых файлов: 5 добавлений и 4 удалений

Просмотреть файл

@ -4735,25 +4735,26 @@ void AsyncPanZoomController::NotifyLayersUpdated(
CSSPoint base = GetCurrentAnimationDestination(lock).valueOr(
Metrics().GetVisualScrollOffset());
CSSPoint destination;
if (StaticPrefs::apz_relative_update_enabled() &&
scrollUpdate.GetType() == ScrollUpdateType::Relative) {
CSSPoint delta =
scrollUpdate.GetDestination() - scrollUpdate.GetSource();
APZC_LOG("%p relative smooth scrolling from %s by %s\n", this,
ToString(base).c_str(), ToString(delta).c_str());
Metrics().ClampAndSetSmoothScrollOffset(base + delta);
destination = Metrics().CalculateScrollRange().ClampPoint(base + delta);
} else if (scrollUpdate.GetType() == ScrollUpdateType::PureRelative) {
CSSPoint delta = scrollUpdate.GetDelta();
APZC_LOG("%p pure-relative smooth scrolling from %s by %s\n", this,
ToString(base).c_str(), ToString(delta).c_str());
Metrics().ClampAndSetSmoothScrollOffset(base + delta);
destination = Metrics().CalculateScrollRange().ClampPoint(base + delta);
} else {
APZC_LOG("%p smooth scrolling to %s\n", this,
ToString(scrollUpdate.GetDestination()).c_str());
Metrics().SetSmoothScrollOffset(scrollUpdate.GetDestination());
destination = scrollUpdate.GetDestination();
}
SmoothScrollTo(Metrics().GetSmoothScrollOffset());
SmoothScrollTo(destination);
continue;
}