Skip to content
Snippets Groups Projects
Commit 5c98206d authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka Committed by Android (Google) Code Review
Browse files

Merge "Use Keyboard.getKey"

parents 040aa28e adc80eef
No related branches found
No related tags found
No related merge requests found
...@@ -167,13 +167,12 @@ public class WordComposer { ...@@ -167,13 +167,12 @@ public class WordComposer {
* Internal method to retrieve reasonable proximity info for a character. * Internal method to retrieve reasonable proximity info for a character.
*/ */
private void addKeyInfo(final int codePoint, final Keyboard keyboard) { private void addKeyInfo(final int codePoint, final Keyboard keyboard) {
for (final Key key : keyboard.mKeys) { final Key key = keyboard.getKey(codePoint);
if (key.mCode == codePoint) { if (key != null) {
final int x = key.mX + key.mWidth / 2; final int x = key.mX + key.mWidth / 2;
final int y = key.mY + key.mHeight / 2; final int y = key.mY + key.mHeight / 2;
add(codePoint, x, y); add(codePoint, x, y);
return; return;
}
} }
add(codePoint, WordComposer.NOT_A_COORDINATE, WordComposer.NOT_A_COORDINATE); add(codePoint, WordComposer.NOT_A_COORDINATE, WordComposer.NOT_A_COORDINATE);
} }
......
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