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

Function stringWidth

tools/pythonauto/static/codemirrorepl/codemirrorepl.js:1744–1748  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

1742 }
1743
1744 function stringWidth(str) {
1745 measure.innerHTML = "<pre><span>x</span></pre>";
1746 measure.firstChild.firstChild.firstChild.nodeValue = str;
1747 return measure.firstChild.firstChild.offsetWidth || 10;
1748 }
1749 // These are used to go from pixel positions to character
1750 // positions, taking varying character widths into account.
1751 function charFromX(line, x) {

Callers 3

CodeMirrorFunction · 0.85
updateDisplayFunction · 0.85
charWidthFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected