(cm, from, to, margin)
| 146 | } |
| 147 | |
| 148 | export function scrollToCoordsRange(cm, from, to, margin) { |
| 149 | let sPos = calculateScrollPos(cm, { |
| 150 | left: Math.min(from.left, to.left), |
| 151 | top: Math.min(from.top, to.top) - margin, |
| 152 | right: Math.max(from.right, to.right), |
| 153 | bottom: Math.max(from.bottom, to.bottom) + margin |
| 154 | }) |
| 155 | scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop) |
| 156 | } |
| 157 | |
| 158 | // Sync the scrollable area and scrollbars, ensure the viewport |
| 159 | // covers the visible area. |
no test coverage detected