Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec5df83c authored by Amith Yamasani's avatar Amith Yamasani
Browse files

Fix to enable having a primary index that's not the closest match.

Needed for predictive hit target correction in LatinIME.
parent 7723c94d
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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;