(cm)
| 3616 | // 'simulates' scrolling that position into view in a cheap way, so |
| 3617 | // that the effect of intermediate scroll commands is not ignored. |
| 3618 | function resolveScrollToPos(cm) { |
| 3619 | var range = cm.curOp.scrollToPos; |
| 3620 | if (range) { |
| 3621 | cm.curOp.scrollToPos = null; |
| 3622 | var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to); |
| 3623 | var sPos = calculateScrollPos(cm, Math.min(from.left, to.left), |
| 3624 | Math.min(from.top, to.top) - range.margin, |
| 3625 | Math.max(from.right, to.right), |
| 3626 | Math.max(from.bottom, to.bottom) + range.margin); |
| 3627 | cm.scrollTo(sPos.scrollLeft, sPos.scrollTop); |
| 3628 | } |
| 3629 | } |
| 3630 | |
| 3631 | // API UTILITIES |
| 3632 |
no test coverage detected
searching dependent graphs…