(cm, pos)
| 2753 | // Used to cheaply estimate the coordinates for a position. Used for |
| 2754 | // intermediate scroll updates. |
| 2755 | function estimateCoords(cm, pos) { |
| 2756 | var left = 0, pos = clipPos(cm.doc, pos); |
| 2757 | if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch; |
| 2758 | var lineObj = getLine(cm.doc, pos.line); |
| 2759 | var top = heightAtLine(lineObj) + paddingTop(cm.display); |
| 2760 | return {left: left, right: left, top: top, bottom: top + lineObj.height}; |
| 2761 | } |
| 2762 | |
| 2763 | // Positions returned by coordsChar contain some extra information. |
| 2764 | // xRel is the relative x position of the input coordinates compared |
no test coverage detected