(cm, pos)
| 4039 | // Used to cheaply estimate the coordinates for a position. Used for |
| 4040 | // intermediate scroll updates. |
| 4041 | function estimateCoords(cm, pos) { |
| 4042 | var left = 0 |
| 4043 | pos = clipPos(cm.doc, pos) |
| 4044 | if (!cm.options.lineWrapping) { |
| 4045 | left = charWidth(cm.display) * pos.ch |
| 4046 | } |
| 4047 | var lineObj = getLine(cm.doc, pos.line) |
| 4048 | var top = heightAtLine(lineObj) + paddingTop(cm.display) |
| 4049 | return { left: left, right: left, top: top, bottom: top + lineObj.height } |
| 4050 | } |
| 4051 | |
| 4052 | // Positions returned by coordsChar contain some extra information. |
| 4053 | // xRel is the relative x position of the input coordinates compared |
no test coverage detected