aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorsatok <satok@google.com>2012-03-19 12:00:00 +0900
committersatok <satok@google.com>2012-03-19 12:49:16 +0900
commitd6d0f6976ccb04570884b188175213bad2e5da61 (patch)
tree2715c5fde00d26cf7dfefaa3324076bda2142b09 /java/src
parent660776e09b9a3b321074a94721d901a035ca1b9f (diff)
downloadlatinime-d6d0f6976ccb04570884b188175213bad2e5da61.tar.gz
latinime-d6d0f6976ccb04570884b188175213bad2e5da61.tar.xz
latinime-d6d0f6976ccb04570884b188175213bad2e5da61.zip
Make the primary character stable
Bug: 4343280 Change-Id: I3e6eaa3803dc32a837825f3a64403430721b6192
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/keyboard/KeyDetector.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/KeyDetector.java b/java/src/com/android/inputmethod/keyboard/KeyDetector.java
index d342c6df0..c2ad56d9f 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyDetector.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyDetector.java
@@ -265,9 +265,9 @@ public class KeyDetector {
for (final Key key: mKeyboard.getNearestKeys(touchX, touchY)) {
final boolean isOnKey = key.isOnKey(touchX, touchY);
final int distance = key.squaredDistanceToEdge(touchX, touchY);
- // TODO: need to take care of hitbox overlaps
+ // To take care of hitbox overlaps, we compare mCode here too.
if (primaryKey == null || distance < minDistance
- || (distance == minDistance && isOnKey)) {
+ || (distance == minDistance && isOnKey && key.mCode > primaryKey.mCode)) {
minDistance = distance;
primaryKey = key;
}