(cm, pos)
| 2677 | // Used to cheaply estimate the coordinates for a position. Used for |
| 2678 | // intermediate scroll updates. |
| 2679 | function estimateCoords(cm, pos) { |
| 2680 | var left = 0; |
| 2681 | pos = clipPos(cm.doc, pos); |
| 2682 | if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; } |
| 2683 | var lineObj = getLine(cm.doc, pos.line); |
| 2684 | var top = heightAtLine(lineObj) + paddingTop(cm.display); |
| 2685 | return {left: left, right: left, top: top, bottom: top + lineObj.height} |
| 2686 | } |
| 2687 | |
| 2688 | // Positions returned by coordsChar contain some extra information. |
| 2689 | // xRel is the relative x position of the input coordinates compared |
no test coverage detected