Bug 1145702 - Make the assertion in Axis::GetOverscroll() more informative. r=Cwiiis

--HG--
extra : source : 9384f096b94ec51b5140699e60b26b611fa05fd2
This commit is contained in:
Botond Ballo 2015-03-20 13:02:23 -04:00
parent 14f75f943c
commit 61cf0d4e08

View File

@ -206,7 +206,14 @@ ParentLayerCoord Axis::GetOverscroll() const {
ParentLayerCoord result = (mOverscroll - mLastOverscrollPeak) / mOverscrollScale;
// Assert that we return overscroll in the correct direction
MOZ_ASSERT((result.value * mFirstOverscrollAnimationSample.value) >= 0.0f);
#ifdef DEBUG
if ((result.value * mFirstOverscrollAnimationSample.value) < 0.0f) {
nsPrintfCString message("GetOverscroll() (%f) and first overscroll animation sample (%f) have different signs\n",
result.value, mFirstOverscrollAnimationSample.value);
NS_ASSERTION(false, message.get());
MOZ_CRASH();
}
#endif
return result;
}