(cm, prepared, ch, bias, varHeight)
| 3328 | // Given a prepared measurement object, measures the position of an |
| 3329 | // actual character (or fetches it from the cache). |
| 3330 | function measureCharPrepared(cm, prepared, ch, bias, varHeight) { |
| 3331 | if (prepared.before) { |
| 3332 | ch = -1; |
| 3333 | } |
| 3334 | var key = ch + (bias || ""), |
| 3335 | found; |
| 3336 | if (prepared.cache.hasOwnProperty(key)) { |
| 3337 | found = prepared.cache[key]; |
| 3338 | } else { |
| 3339 | if (!prepared.rect) { |
| 3340 | prepared.rect = prepared.view.text.getBoundingClientRect(); |
| 3341 | } |
| 3342 | if (!prepared.hasHeights) { |
| 3343 | ensureLineHeights(cm, prepared.view, prepared.rect); |
| 3344 | prepared.hasHeights = true; |
| 3345 | } |
| 3346 | found = measureCharInner(cm, prepared, ch, bias); |
| 3347 | if (!found.bogus) { |
| 3348 | prepared.cache[key] = found; |
| 3349 | } |
| 3350 | } |
| 3351 | return { |
| 3352 | left: found.left, |
| 3353 | right: found.right, |
| 3354 | top: varHeight ? found.rtop : found.top, |
| 3355 | bottom: varHeight ? found.rbottom : found.bottom, |
| 3356 | }; |
| 3357 | } |
| 3358 | |
| 3359 | var nullRect = { left: 0, right: 0, top: 0, bottom: 0 }; |
| 3360 |
no test coverage detected