MCPcopy Index your code
hub / github.com/witheve/Eve / getY

Function getY

src/annotatescrollbar.js:75–85  ·  view source on GitHub ↗
(pos, top)

Source from the content-addressed store, hash-verified

73 var singleLineH = wrapping && cm.defaultTextHeight() * 1.5;
74 var curLine = null, curLineObj = null;
75 function getY(pos, top) {
76 if (curLine != pos.line) {
77 curLine = pos.line;
78 curLineObj = cm.getLineHandle(curLine);
79 }
80 if(!curLineObj) return;
81 if (wrapping && curLineObj.height > singleLineH)
82 return cm.charCoords(pos, "local")[top ? "top" : "bottom"];
83 var topY = cm.heightAtLine(curLineObj, "local");
84 return topY + (top ? 0 : curLineObj.height);
85 }
86
87 if (cm.display.barWidth) for (var i = 0, nextTop; i < anns.length; i++) {
88 var ann = anns[i];

Callers 1

Calls 3

getLineHandleMethod · 0.80
charCoordsMethod · 0.80
heightAtLineMethod · 0.80

Tested by

no test coverage detected