Refine gesture point duration calcuation to be more localized

Bug: 7165929
Change-Id: I3bb1c2622338023626fe4a879e43a86ac8fd0707
main
Tom Ouyang 2012-09-18 22:56:09 -07:00
parent 01a5a7d061
commit a811938d40
1 changed files with 2 additions and 2 deletions

View File

@ -464,8 +464,8 @@ float ProximityInfoState::calculateNormalizedSquaredDistance(
}
int ProximityInfoState::getDuration(const int index) const {
if (mInputSize > 0 && index > 0 && index < mInputSize - 1) {
return mTimes[index + 1] - mTimes[index - 1];
if (mInputSize > 0 && index >= 0 && index < mInputSize - 1) {
return mTimes[index + 1] - mTimes[index];
}
return 0;
}