Skip to content
Snippets Groups Projects
Commit 67094f5b authored by satok's avatar satok
Browse files

Do not re-calculate primary code in WordComposer

Bug: 4343280
Test: Ib43c0f1d1a19d067ea0

Change-Id: I3393a6099cb7fb824994f4656ccfef884f9c6bc4
parent 1551119e
No related branches found
No related tags found
No related merge requests found
......@@ -139,9 +139,8 @@ public class WordComposer {
keyX = x;
keyY = y;
} else {
final Key key = keyDetector.detectHitKey(x, y);
// TODO: Pass an integer instead of an integer array
codes = new int[] { key != null ? key.mCode : NOT_A_CODE };
codes = new int[] { primaryCode };
keyX = keyDetector.getTouchX(x);
keyY = keyDetector.getTouchY(y);
}
......@@ -158,7 +157,8 @@ public class WordComposer {
mTypedWord.appendCodePoint(primaryCode);
refreshSize();
if (newIndex < BinaryDictionary.MAX_WORD_LENGTH) {
mPrimaryKeyCodes[newIndex] = codes[0];
mPrimaryKeyCodes[newIndex] = primaryCode >= Keyboard.CODE_SPACE
? Character.toLowerCase(primaryCode) : primaryCode;
mXCoordinates[newIndex] = keyX;
mYCoordinates[newIndex] = keyY;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment