MCPcopy Create free account
hub / github.com/sql-js/sql.js / heightAtLine

Function heightAtLine

GUI/codemirror/lib/codemirror.js:6555–6572  ·  view source on GitHub ↗
(lineObj)

Source from the content-addressed store, hash-verified

6553
6554 // Find the height above the given line.
6555 function heightAtLine(lineObj) {
6556 lineObj = visualLine(lineObj);
6557
6558 var h = 0, chunk = lineObj.parent;
6559 for (var i = 0; i < chunk.lines.length; ++i) {
6560 var line = chunk.lines[i];
6561 if (line == lineObj) break;
6562 else h += line.height;
6563 }
6564 for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {
6565 for (var i = 0; i < p.children.length; ++i) {
6566 var cur = p.children[i];
6567 if (cur == chunk) break;
6568 else h += cur.height;
6569 }
6570 }
6571 return h;
6572 }
6573
6574 // Get the bidi ordering for the given line (and cache it). Returns
6575 // false for lines that are fully left-to-right, and an array of

Callers 8

visibleLinesFunction · 0.85
updateDisplayInnerFunction · 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…