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

Function estimateHeight

tools/pythonauto/static/codemirror/codemirror.js:231–242  ·  view source on GitHub ↗
(cm)

Source from the content-addressed store, hash-verified

229 }
230
231 function estimateHeight(cm) {
232 var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;
233 var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);
234 return function(line) {
235 if (lineIsHidden(cm.doc, line))
236 return 0;
237 else if (wrapping)
238 return (Math.ceil(line.text.length / perLine) || 1) * th;
239 else
240 return th;
241 };
242 }
243
244 function estimateLineHeights(cm) {
245 var doc = cm.doc, est = estimateHeight(cm);

Callers 4

estimateLineHeightsFunction · 0.70
codemirror.jsFile · 0.70
updateLineFunction · 0.70

Calls 3

textHeightFunction · 0.70
charWidthFunction · 0.70
lineIsHiddenFunction · 0.70

Tested by

no test coverage detected