(chunk, h)
| 946 | // Find the line at the given vertical position, using the height |
| 947 | // information in the document tree. |
| 948 | function lineAtHeight(chunk, h) { |
| 949 | var n = chunk.first; |
| 950 | outer: do { |
| 951 | for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) { |
| 952 | var child = chunk.children[i$1], ch = child.height; |
| 953 | if (h < ch) { chunk = child; continue outer } |
| 954 | h -= ch; |
| 955 | n += child.chunkSize(); |
| 956 | } |
| 957 | return n |
| 958 | } while (!chunk.lines) |
| 959 | var i = 0; |
| 960 | for (; i < chunk.lines.length; ++i) { |
| 961 | var line = chunk.lines[i], lh = line.height; |
| 962 | if (h < lh) { break } |
| 963 | h -= lh; |
| 964 | } |
| 965 | return n + i |
| 966 | } |
| 967 | |
| 968 | function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size} |
| 969 |
no outgoing calls
no test coverage detected