MCPcopy Create free account
hub / github.com/TruthHun/BookStack / heightAtLine

Function heightAtLine

static/mergely/lib/codemirror.js:7838–7855  ·  view source on GitHub ↗
(lineObj)

Source from the content-addressed store, hash-verified

7836
7837 // Find the height above the given line.
7838 function heightAtLine(lineObj) {
7839 lineObj = visualLine(lineObj);
7840
7841 var h = 0, chunk = lineObj.parent;
7842 for (var i = 0; i < chunk.lines.length; ++i) {
7843 var line = chunk.lines[i];
7844 if (line == lineObj) break;
7845 else h += line.height;
7846 }
7847 for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {
7848 for (var i = 0; i < p.children.length; ++i) {
7849 var cur = p.children[i];
7850 if (cur == chunk) break;
7851 else h += cur.height;
7852 }
7853 }
7854 return h;
7855 }
7856
7857 // Get the bidi ordering for the given line (and cache it). Returns
7858 // false for lines that are fully left-to-right, and an array of

Callers 8

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

Calls 1

visualLineFunction · 0.70

Tested by

no test coverage detected