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

Function localCoords

tools/pythonauto/static/codemirrorepl/codemirrorepl.js:1795–1804  ·  view source on GitHub ↗
(pos, inLineWrap)

Source from the content-addressed store, hash-verified

1793 return {top: top, left: left};
1794 }
1795 function localCoords(pos, inLineWrap) {
1796 var x, lh = textHeight(), y = lh * (heightAtLine(doc, pos.line) - (inLineWrap ? displayOffset : 0));
1797 if (pos.ch == 0) x = 0;
1798 else {
1799 var sp = measureLine(getLine(pos.line), pos.ch);
1800 x = sp.left;
1801 if (options.lineWrapping) y += Math.max(0, sp.top);
1802 }
1803 return {x: x, y: y, yBot: y + lh};
1804 }
1805 // Coords must be lineSpace-local
1806 function coordsChar(x, y) {
1807 if (y < 0) y = 0;

Callers 5

CodeMirrorFunction · 0.85
scrollCursorIntoViewFunction · 0.85
updateSelectionFunction · 0.85
moveVFunction · 0.85
pageCoordsFunction · 0.85

Calls 4

textHeightFunction · 0.70
heightAtLineFunction · 0.70
measureLineFunction · 0.70
getLineFunction · 0.70

Tested by

no test coverage detected