(cm, from, to, margin)
| 5018 | } |
| 5019 | |
| 5020 | function scrollToCoordsRange(cm, from, to, margin) { |
| 5021 | var sPos = calculateScrollPos(cm, { |
| 5022 | left: Math.min(from.left, to.left), |
| 5023 | top: Math.min(from.top, to.top) - margin, |
| 5024 | right: Math.max(from.right, to.right), |
| 5025 | bottom: Math.max(from.bottom, to.bottom) + margin |
| 5026 | }) |
| 5027 | scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop) |
| 5028 | } |
| 5029 | |
| 5030 | // Sync the scrollable area and scrollbars, ensure the viewport |
| 5031 | // covers the visible area. |
no test coverage detected