lookup method

KeyMorph lookup(
  1. KeyGeometry rest,
  2. KeyGeometry pressed,
  3. double aspect
)

The cached morph, building it on a miss.

Implementation

KeyMorph lookup(KeyGeometry rest, KeyGeometry pressed, double aspect) {
  final key = (rest, pressed, aspectKey(aspect));
  final hit = _entries.remove(key);
  if (hit != null) return _entries[key] = hit;
  misses++;
  return _insert(key, _build(rest, pressed, key.$3 / 100));
}