Follow-up fix for I68c667b0

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

Change-Id: I97b05aa24006402be03088a215fa07abda9477df
main
Ken Wakasa 2011-12-19 17:58:36 +09:00
parent 42fcb2de64
commit 4f7d278af6
1 changed files with 4 additions and 1 deletions

View File

@ -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) {