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

Commit 4f7d278a authored by Ken Wakasa's avatar Ken Wakasa
Browse files

Follow-up fix for I68c667b0

Should have preserved the logic of LatinKeyboard.getNearestKeys().

Change-Id: I97b05aa24006402be03088a215fa07abda9477df
parent 42fcb2de
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -403,7 +403,10 @@ public class Keyboard {
     * point is out of range, then an array of size zero is returned.
     */
    public Key[] getNearestKeys(int x, int y) {
        return mProximityInfo.getNearestKeys(x, y);
        // Avoid dead pixels at edges of the keyboard
        final int adjustedX = Math.max(0, Math.min(x, mOccupiedWidth - 1));
        final int adjustedY = Math.max(0, Math.min(y, mOccupiedHeight - 1));
        return mProximityInfo.getNearestKeys(adjustedX, adjustedY);
    }

    public static String printableCode(int code) {