MCPcopy Create free account
hub / github.com/TruthHun/BookStack / getX

Function getX

static/editor.md/lib/codemirror/lib/codemirror.js:2804–2811  ·  view source on GitHub ↗
(ch)

Source from the content-addressed store, hash-verified

2802 var preparedMeasure = prepareMeasureForLine(cm, lineObj);
2803
2804 function getX(ch) {
2805 var sp = cursorCoords(cm, Pos(lineNo, ch), "line", lineObj, preparedMeasure);
2806 wrongLine = true;
2807 if (innerOff > sp.bottom) return sp.left - adjust;
2808 else if (innerOff < sp.top) return sp.left + adjust;
2809 else wrongLine = false;
2810 return sp.left;
2811 }
2812
2813 var bidi = getOrder(lineObj), dist = lineObj.text.length;
2814 var from = lineLeft(lineObj), to = lineRight(lineObj);

Callers 1

coordsCharInnerFunction · 0.70

Calls 1

cursorCoordsFunction · 0.70

Tested by

no test coverage detected