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

Function getX

static/mergely/lib/codemirror.js:2910–2917  ·  view source on GitHub ↗
(ch)

Source from the content-addressed store, hash-verified

2908 var preparedMeasure = prepareMeasureForLine(cm, lineObj);
2909
2910 function getX(ch) {
2911 var sp = cursorCoords(cm, Pos(lineNo, ch), "line", lineObj, preparedMeasure);
2912 wrongLine = true;
2913 if (innerOff > sp.bottom) return sp.left - adjust;
2914 else if (innerOff < sp.top) return sp.left + adjust;
2915 else wrongLine = false;
2916 return sp.left;
2917 }
2918
2919 var bidi = getOrder(lineObj), dist = lineObj.text.length;
2920 var from = lineLeft(lineObj), to = lineRight(lineObj);

Callers 1

coordsCharInnerFunction · 0.70

Calls 1

cursorCoordsFunction · 0.70

Tested by

no test coverage detected