(cm, prepared, ch, bias)
| 1536 | // Given a prepared measurement object, measures the position of an |
| 1537 | // actual character (or fetches it from the cache). |
| 1538 | function measureCharPrepared(cm, prepared, ch, bias) { |
| 1539 | if (prepared.before) ch = -1; |
| 1540 | var key = ch + (bias || ""), found; |
| 1541 | if (prepared.cache.hasOwnProperty(key)) { |
| 1542 | found = prepared.cache[key]; |
| 1543 | } else { |
| 1544 | if (!prepared.rect) |
| 1545 | prepared.rect = prepared.view.text.getBoundingClientRect(); |
| 1546 | if (!prepared.hasHeights) { |
| 1547 | ensureLineHeights(cm, prepared.view, prepared.rect); |
| 1548 | prepared.hasHeights = true; |
| 1549 | } |
| 1550 | found = measureCharInner(cm, prepared, ch, bias); |
| 1551 | if (!found.bogus) prepared.cache[key] = found; |
| 1552 | } |
| 1553 | return {left: found.left, right: found.right, top: found.top, bottom: found.bottom}; |
| 1554 | } |
| 1555 | |
| 1556 | var nullRect = {left: 0, right: 0, top: 0, bottom: 0}; |
| 1557 |
no test coverage detected