Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a811938d authored by Tom Ouyang's avatar Tom Ouyang
Browse files

Refine gesture point duration calcuation to be more localized

Bug: 7165929
Change-Id: I3bb1c2622338023626fe4a879e43a86ac8fd0707
parent 01a5a7d0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
}