MCPcopy Index your code
hub / github.com/csev/py4e / textHeight

Function textHeight

tools/pythonauto/static/codemirrorepl/codemirrorepl.js:1848–1861  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1846
1847 var cachedHeight, cachedHeightFor, measureText;
1848 function textHeight() {
1849 if (measureText == null) {
1850 measureText = "<pre>";
1851 for (var i = 0; i < 49; ++i) measureText += "x<br/>";
1852 measureText += "x</pre>";
1853 }
1854 var offsetHeight = lineDiv.clientHeight;
1855 if (offsetHeight == cachedHeightFor) return cachedHeight;
1856 cachedHeightFor = offsetHeight;
1857 measure.innerHTML = measureText;
1858 cachedHeight = measure.firstChild.offsetHeight / 50 || 1;
1859 measure.innerHTML = "";
1860 return cachedHeight;
1861 }
1862 var cachedWidth, cachedWidthFor = 0;
1863 function charWidth() {
1864 if (scroller.clientWidth == cachedWidthFor) return cachedWidth;

Callers 8

CodeMirrorFunction · 0.70
updateLinesNoUndoFunction · 0.70
visibleLinesFunction · 0.70
updateDisplayFunction · 0.70
updateSelectionFunction · 0.70
moveVFunction · 0.70
localCoordsFunction · 0.70
coordsCharFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected