Bug 1164557 - Weed out spurious calls to Axis::OverscrollBy() caused by rounding error r=kats

This commit is contained in:
Botond Ballo 2015-05-13 15:48:50 -04:00
parent 2c82fd3112
commit ed212a4d92

View File

@ -182,6 +182,11 @@ ParentLayerCoord Axis::ApplyResistance(ParentLayerCoord aRequestedOverscroll) co
void Axis::OverscrollBy(ParentLayerCoord aOverscroll) {
MOZ_ASSERT(CanScroll());
// We can get some spurious calls to OverscrollBy() with near-zero values
// due to rounding error. Ignore those (they might trip the asserts below.)
if (FuzzyEqualsAdditive(aOverscroll.value, 0.0f, COORDINATE_EPSILON)) {
return;
}
ClearOverscrollAnimationState();
aOverscroll = ApplyResistance(aOverscroll);
if (aOverscroll > 0) {