Do not re-calculate primary code in WordComposer

Bug: 4343280
Test: Ib43c0f1d1a19d067ea0

Change-Id: I3393a6099cb7fb824994f4656ccfef884f9c6bc4
This commit is contained in:
satok 2012-03-28 16:30:52 +09:00
parent 1551119e06
commit 67094f5bde

View file

@ -139,9 +139,8 @@ public class WordComposer {
keyX = x; keyX = x;
keyY = y; keyY = y;
} else { } else {
final Key key = keyDetector.detectHitKey(x, y);
// TODO: Pass an integer instead of an integer array // 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); keyX = keyDetector.getTouchX(x);
keyY = keyDetector.getTouchY(y); keyY = keyDetector.getTouchY(y);
} }
@ -158,7 +157,8 @@ public class WordComposer {
mTypedWord.appendCodePoint(primaryCode); mTypedWord.appendCodePoint(primaryCode);
refreshSize(); refreshSize();
if (newIndex < BinaryDictionary.MAX_WORD_LENGTH) { if (newIndex < BinaryDictionary.MAX_WORD_LENGTH) {
mPrimaryKeyCodes[newIndex] = codes[0]; mPrimaryKeyCodes[newIndex] = primaryCode >= Keyboard.CODE_SPACE
? Character.toLowerCase(primaryCode) : primaryCode;
mXCoordinates[newIndex] = keyX; mXCoordinates[newIndex] = keyX;
mYCoordinates[newIndex] = keyY; mYCoordinates[newIndex] = keyY;
} }