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

Commit f9c2773b authored by satok's avatar satok Committed by Android (Google) Code Review
Browse files

Merge "Make the primary character stable"

parents 9ffb94fa d6d0f697
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
            }