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

Commit 93c31e17 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka Committed by Android Git Automerger
Browse files

am 530fd15e: Fix bug to update last interpolated index of GestureStroke

* commit '530fd15e':
  Fix bug to update last interpolated index of GestureStroke
parents 17e55d3b 530fd15e
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -261,14 +261,14 @@ final class GesturePreviewTrail {
                System.arraycopy(eventTimes, startIndex, eventTimes, 0, newSize);
                System.arraycopy(xCoords, startIndex, xCoords, 0, newSize);
                System.arraycopy(yCoords, startIndex, yCoords, 0, newSize);
                // The start index of the last segment of the stroke
                // {@link mLastInterpolatedDrawIndex} should also be updated because all array
                // elements have just been shifted for compaction.
                mLastInterpolatedDrawIndex = Math.max(mLastInterpolatedDrawIndex - startIndex, 0);
            }
            mEventTimes.setLength(newSize);
            mXCoordinates.setLength(newSize);
            mYCoordinates.setLength(newSize);
            // The start index of the last segment of the stroke
            // {@link mLastInterpolatedDrawIndex} should also be updated because all array
            // elements have just been shifted for compaction or been zeroed.
            mLastInterpolatedDrawIndex = Math.max(mLastInterpolatedDrawIndex - startIndex, 0);
        }
        return newSize > 0;
    }