(cm, prepared, ch, bias, varHeight)
| 2407 | // Given a prepared measurement object, measures the position of an |
| 2408 | // actual character (or fetches it from the cache). |
| 2409 | function measureCharPrepared(cm, prepared, ch, bias, varHeight) { |
| 2410 | if (prepared.before) { ch = -1; } |
| 2411 | var key = ch + (bias || ""), found; |
| 2412 | if (prepared.cache.hasOwnProperty(key)) { |
| 2413 | found = prepared.cache[key]; |
| 2414 | } else { |
| 2415 | if (!prepared.rect) |
| 2416 | { prepared.rect = prepared.view.text.getBoundingClientRect(); } |
| 2417 | if (!prepared.hasHeights) { |
| 2418 | ensureLineHeights(cm, prepared.view, prepared.rect); |
| 2419 | prepared.hasHeights = true; |
| 2420 | } |
| 2421 | found = measureCharInner(cm, prepared, ch, bias); |
| 2422 | if (!found.bogus) { prepared.cache[key] = found; } |
| 2423 | } |
| 2424 | return {left: found.left, right: found.right, |
| 2425 | top: varHeight ? found.rtop : found.top, |
| 2426 | bottom: varHeight ? found.rbottom : found.bottom} |
| 2427 | } |
| 2428 | |
| 2429 | var nullRect = {left: 0, right: 0, top: 0, bottom: 0}; |
| 2430 |
no test coverage detected