(cm, pos)
| 1744 | // Used to cheaply estimate the coordinates for a position. Used for |
| 1745 | // intermediate scroll updates. |
| 1746 | function estimateCoords(cm, pos) { |
| 1747 | var left = 0, pos = clipPos(cm.doc, pos); |
| 1748 | if (!cm.options.lineWrapping) left = charWidth(cm.display) * pos.ch; |
| 1749 | var lineObj = getLine(cm.doc, pos.line); |
| 1750 | var top = heightAtLine(lineObj) + paddingTop(cm.display); |
| 1751 | return {left: left, right: left, top: top, bottom: top + lineObj.height}; |
| 1752 | } |
| 1753 | |
| 1754 | // Positions returned by coordsChar contain some extra information. |
| 1755 | // xRel is the relative x position of the input coordinates compared |
no test coverage detected