зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
80742a3694
Коммит
03e7bbc347
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче