diff options
| author | 2017-12-21 18:29:00 +0000 | |
|---|---|---|
| committer | 2017-12-21 18:29:00 +0000 | |
| commit | 0e603f03e629d9825eb4c0872928499c0b76c7e7 (patch) | |
| tree | 9dd52d067157af270bcfa78c6ce625c56979ec41 | |
| parent | bc610e14321e15fc69adbd4b742bf82b348e8b1e (diff) | |
| parent | 7ee0dba09550811040df4d7b494766f7d146e3de (diff) | |
Merge "Fix doFadingAnimationLocked in sanitized builds."
| -rw-r--r-- | libs/input/PointerController.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/input/PointerController.cpp b/libs/input/PointerController.cpp index 7c6046789cdc..e3af65532f85 100644 --- a/libs/input/PointerController.cpp +++ b/libs/input/PointerController.cpp @@ -551,18 +551,20 @@ bool PointerController::doFadingAnimationLocked(nsecs_t timestamp) { } // Animate spots that are fading out and being removed. - for (size_t i = 0; i < mLocked.spots.size(); i++) { + for (size_t i = 0; i < mLocked.spots.size();) { Spot* spot = mLocked.spots.itemAt(i); if (spot->id == Spot::INVALID_ID) { spot->alpha -= float(frameDelay) / SPOT_FADE_DURATION; if (spot->alpha <= 0) { - mLocked.spots.removeAt(i--); + mLocked.spots.removeAt(i); releaseSpotLocked(spot); + continue; } else { spot->sprite->setAlpha(spot->alpha); keepAnimating = true; } } + ++i; } return keepAnimating; } |