MCPcopy
hub / github.com/witheve/Eve / heightAtLine

Function heightAtLine

src/codemirror.js:7870–7887  ·  view source on GitHub ↗
(lineObj)

Source from the content-addressed store, hash-verified

7868
7869 // Find the height above the given line.
7870 function heightAtLine(lineObj) {
7871 lineObj = visualLine(lineObj);
7872
7873 var h = 0, chunk = lineObj.parent;
7874 for (var i = 0; i < chunk.lines.length; ++i) {
7875 var line = chunk.lines[i];
7876 if (line == lineObj) break;
7877 else h += line.height;
7878 }
7879 for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {
7880 for (var i = 0; i < p.children.length; ++i) {
7881 var cur = p.children[i];
7882 if (cur == chunk) break;
7883 else h += cur.height;
7884 }
7885 }
7886 return h;
7887 }
7888
7889 // Get the bidi ordering for the given line (and cache it). Returns
7890 // false for lines that are fully left-to-right, and an array of

Callers 8

visibleLinesFunction · 0.85
updateDisplayIfNeededFunction · 0.85
intoCoordSystemFunction · 0.85
estimateCoordsFunction · 0.85
coordsCharInnerFunction · 0.85
codemirror.jsFile · 0.85
addLineWidgetFunction · 0.85

Calls 1

visualLineFunction · 0.85

Tested by

no test coverage detected