summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2010-02-08 15:24:57 -0800
committerAmith Yamasani <yamasani@google.com>2010-02-08 15:26:00 -0800
commitec5df83c5b44ad2f2b28a1a4420c4c4056dd6103 (patch)
tree43d208c8bd8cb4e79e8768a0319dad7700316270 /core
parent7723c94d3295de4e9a2b14cbf9f3a9a999f201d2 (diff)
downloadframeworks_base-ec5df83c5b44ad2f2b28a1a4420c4c4056dd6103.zip
frameworks_base-ec5df83c5b44ad2f2b28a1a4420c4c4056dd6103.tar.gz
frameworks_base-ec5df83c5b44ad2f2b28a1a4420c4c4056dd6103.tar.bz2
Fix to enable having a primary index that's not the closest match.
Needed for predictive hit target correction in LatinIME.
Diffstat (limited to 'core')
-rwxr-xr-xcore/java/android/inputmethodservice/KeyboardView.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/java/android/inputmethodservice/KeyboardView.java b/core/java/android/inputmethodservice/KeyboardView.java
index cecacaa..28a86b8 100755
--- a/core/java/android/inputmethodservice/KeyboardView.java
+++ b/core/java/android/inputmethodservice/KeyboardView.java
@@ -742,6 +742,10 @@ public class KeyboardView extends View implements View.OnClickListener {
final Key key = keys[nearestKeyIndices[i]];
int dist = 0;
boolean isInside = key.isInside(x,y);
+ if (isInside) {
+ primaryIndex = nearestKeyIndices[i];
+ }
+
if (((mProximityCorrectOn
&& (dist = key.squaredDistanceFrom(x, y)) < mProximityThreshold)
|| isInside)
@@ -770,10 +774,6 @@ public class KeyboardView extends View implements View.OnClickListener {
}
}
}
-
- if (isInside) {
- primaryIndex = nearestKeyIndices[i];
- }
}
if (primaryIndex == NOT_A_KEY) {
primaryIndex = closestKey;