MCPcopy
hub / github.com/csev/py4e / heightAtLine

Function heightAtLine

tools/pythonauto/static/codemirrorepl/codemirror.js:6505–6522  ·  view source on GitHub ↗
(lineObj)

Source from the content-addressed store, hash-verified

6503
6504 // Find the height above the given line.
6505 function heightAtLine(lineObj) {
6506 lineObj = visualLine(lineObj);
6507
6508 var h = 0, chunk = lineObj.parent;
6509 for (var i = 0; i < chunk.lines.length; ++i) {
6510 var line = chunk.lines[i];
6511 if (line == lineObj) break;
6512 else h += line.height;
6513 }
6514 for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {
6515 for (var i = 0; i < p.children.length; ++i) {
6516 var cur = p.children[i];
6517 if (cur == chunk) break;
6518 else h += cur.height;
6519 }
6520 }
6521 return h;
6522 }
6523
6524 // Get the bidi ordering for the given line (and cache it). Returns
6525 // false for lines that are fully left-to-right, and an array of

Callers 8

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