MCPcopy
hub / github.com/DHTMLX/gantt / heightAtLine

Function heightAtLine

samples/common/codehighlight/codemirror.js:1622–1639  ·  view source on GitHub ↗
(lineObj)

Source from the content-addressed store, hash-verified

1620
1621 // Find the height above the given line.
1622 function heightAtLine(lineObj) {
1623 lineObj = visualLine(lineObj);
1624
1625 var h = 0, chunk = lineObj.parent;
1626 for (var i = 0; i < chunk.lines.length; ++i) {
1627 var line = chunk.lines[i];
1628 if (line == lineObj) { break }
1629 else { h += line.height; }
1630 }
1631 for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {
1632 for (var i$1 = 0; i$1 < p.children.length; ++i$1) {
1633 var cur = p.children[i$1];
1634 if (cur == chunk) { break }
1635 else { h += cur.height; }
1636 }
1637 }
1638 return h
1639 }
1640
1641 // Compute the character length of a line, taking into account
1642 // collapsed ranges (see markText) that might hide parts, and join

Callers 8

intoCoordSystemFunction · 0.85
estimateCoordsFunction · 0.85
coordsCharInnerFunction · 0.85
visibleLinesFunction · 0.85
updateDisplayIfNeededFunction · 0.85
addLineWidgetFunction · 0.85
addEditorMethodsFunction · 0.85

Calls 1

visualLineFunction · 0.85

Tested by

no test coverage detected