aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2013-04-17 11:58:09 +0900
committerTadashi G. Takaoka <takaoka@google.com>2013-04-17 11:58:09 +0900
commitedc49d38e6d4c5e1bf5dfe5c30938f2aeb232f2e (patch)
treed1051f6fe8e26891f0d7246ec37a72e3458189f6 /java/src
parent3970352ea907cbea63e342f370bb0bbb9cc7335a (diff)
downloadlatinime-edc49d38e6d4c5e1bf5dfe5c30938f2aeb232f2e.tar.gz
latinime-edc49d38e6d4c5e1bf5dfe5c30938f2aeb232f2e.tar.xz
latinime-edc49d38e6d4c5e1bf5dfe5c30938f2aeb232f2e.zip
Fix bug to update last interpolated index of GestureStroke
Bug: 8556775 Change-Id: Ie12e0dc9bfeae45f6883580801e07d44be1d1d33
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/keyboard/internal/GesturePreviewTrail.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/internal/GesturePreviewTrail.java b/java/src/com/android/inputmethod/keyboard/internal/GesturePreviewTrail.java
index 0c050610d..7fd1bedcb 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/GesturePreviewTrail.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/GesturePreviewTrail.java
@@ -108,7 +108,7 @@ final class GesturePreviewTrail {
}
private void addStrokeLocked(final GestureStrokeWithPreviewPoints stroke, final long downTime) {
- final int trailSize = mEventTimes.getLength();
+ final int trailSize = mEventTimes.getLength();
stroke.appendPreviewStroke(mEventTimes, mXCoordinates, mYCoordinates);
if (mEventTimes.getLength() == trailSize) {
return;
@@ -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;
}