(chunk, h)
| 1044 | // Find the line at the given vertical position, using the height |
| 1045 | // information in the document tree. |
| 1046 | function lineAtHeight(chunk, h) { |
| 1047 | var n = chunk.first |
| 1048 | outer: do { |
| 1049 | for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) { |
| 1050 | var child = chunk.children[i$1], |
| 1051 | ch = child.height |
| 1052 | if (h < ch) { |
| 1053 | chunk = child |
| 1054 | continue outer |
| 1055 | } |
| 1056 | h -= ch |
| 1057 | n += child.chunkSize() |
| 1058 | } |
| 1059 | return n |
| 1060 | } while (!chunk.lines) |
| 1061 | var i = 0 |
| 1062 | for (; i < chunk.lines.length; ++i) { |
| 1063 | var line = chunk.lines[i], |
| 1064 | lh = line.height |
| 1065 | if (h < lh) { |
| 1066 | break |
| 1067 | } |
| 1068 | h -= lh |
| 1069 | } |
| 1070 | return n + i |
| 1071 | } |
| 1072 | |
| 1073 | function isLine(doc, l) { |
| 1074 | return l >= doc.first && l < doc.first + doc.size |
no outgoing calls
no test coverage detected