Fix a bug with negative coordinates, step 1

This breaks style guidelines but for some reason git diff gets
so lost on this re-indent that it's better to do it like this

Change-Id: Ie0a603eb0739704894a5adc25f9d527b37bdf151
main
Jean Chalard 2012-03-23 19:25:10 +09:00
parent 2b5b6388d6
commit 88ec125cfc
1 changed files with 39 additions and 37 deletions

View File

@ -156,6 +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);
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) {
@ -207,6 +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;