diff options
author | 2011-04-28 21:47:13 +0900 | |
---|---|---|
committer | 2011-04-28 22:10:02 +0900 | |
commit | 8d165bb5d19a266b126b52907db8d7f9e384c7e4 (patch) | |
tree | a86cc392af5091a2c82d166dc3d6dab63344c6ae /java/src | |
parent | d8f52a4f18d22aa150846b01017410ce70bbad6f (diff) | |
download | latinime-8d165bb5d19a266b126b52907db8d7f9e384c7e4.tar.gz latinime-8d165bb5d19a266b126b52907db8d7f9e384c7e4.tar.xz latinime-8d165bb5d19a266b126b52907db8d7f9e384c7e4.zip |
Fix a bug where dead space would appear on the keyboard.
This change fixes a bug where there would be pixels on the keyboard
that would not return a key although it's between two keys - or even
right on top of one.
This change makes it so that the closest key to the touch - within a
certain threshold - is always returned, regardless of whether the
touch is inside or not.
Bug: 4348994
Change-Id: I8f6102d6787eb025cc3c50a26d3a475aeafc4b64
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/keyboard/KeyDetector.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/KeyDetector.java b/java/src/com/android/inputmethod/keyboard/KeyDetector.java index 2eeae96b2..4d3c3422a 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyDetector.java +++ b/java/src/com/android/inputmethod/keyboard/KeyDetector.java @@ -174,11 +174,12 @@ public class KeyDetector { int primaryIndex = NOT_A_KEY; for (final int index : mKeyboard.getNearestKeys(touchX, touchY)) { final Key key = keys.get(index); + // TODO: should be okay to skip calling isInside() final boolean isInside = mKeyboard.isInside(key, touchX, touchY); final int distance = key.squaredDistanceToEdge(touchX, touchY); if (isInside || (mProximityCorrectOn && distance < mProximityThresholdSquare)) { final int insertedPosition = sortNearbyKeys(index, distance); - if (insertedPosition == 0 && isInside) + if (insertedPosition == 0) primaryIndex = index; } } |