mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Merge "Make the primary character stable"
This commit is contained in:
commit
f9c2773b09
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user