(cm, pos)
| 2859 | // Used to cheaply estimate the coordinates for a position. Used for |
| 2860 | // intermediate scroll updates. |
| 2861 | function estimateCoords(cm, pos) { |
| 2862 | var left = 0, pos = clipPos(cm.doc, pos); |
| 2863 | if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch; |
| 2864 | var lineObj = getLine(cm.doc, pos.line); |
| 2865 | var top = heightAtLine(lineObj) + paddingTop(cm.display); |
| 2866 | return {left: left, right: left, top: top, bottom: top + lineObj.height}; |
| 2867 | } |
| 2868 | |
| 2869 | // Positions returned by coordsChar contain some extra information. |
| 2870 | // xRel is the relative x position of the input coordinates compared |
no test coverage detected