Merge "Fix a bug with negative coordinates, step 3"

main
Jean Chalard 2012-03-23 04:04:48 -07:00 committed by Android (Google) Code Review
commit 350ffc879a
1 changed files with 2 additions and 2 deletions

View File

@ -156,7 +156,7 @@ void ProximityInfo::calculateNearbyKeyCodes(
int insertPos = 0; int insertPos = 0;
inputCodes[insertPos++] = primaryKey; inputCodes[insertPos++] = primaryKey;
const int startIndex = getStartIndexFromCoordinates(x, y); const int startIndex = getStartIndexFromCoordinates(x, y);
if (startIndex >= 0) {
for (int i = 0; i < MAX_PROXIMITY_CHARS_SIZE; ++i) { for (int i = 0; i < MAX_PROXIMITY_CHARS_SIZE; ++i) {
const int32_t c = mProximityCharsArray[startIndex + i]; const int32_t c = mProximityCharsArray[startIndex + i];
if (c < KEYCODE_SPACE || c == primaryKey) { if (c < KEYCODE_SPACE || c == primaryKey) {
@ -208,7 +208,7 @@ void ProximityInfo::calculateNearbyKeyCodes(
} }
} }
} }
}
// Add a delimiter for the proximity characters // Add a delimiter for the proximity characters
for (int i = insertPos; i < MAX_PROXIMITY_CHARS_SIZE; ++i) { for (int i = insertPos; i < MAX_PROXIMITY_CHARS_SIZE; ++i) {
inputCodes[i] = NOT_A_CODE; inputCodes[i] = NOT_A_CODE;