MCPcopy Create free account
hub / github.com/breck7/scroll / scrollToCoordsRange

Function scrollToCoordsRange

external/.scrollLibs.js:5020–5028  ·  view source on GitHub ↗
(cm, from, to, margin)

Source from the content-addressed store, hash-verified

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.

Callers 2

resolveScrollToPosFunction · 0.85
addEditorMethodsFunction · 0.85

Calls 4

calculateScrollPosFunction · 0.85
scrollToCoordsFunction · 0.85
minMethod · 0.80
maxMethod · 0.80

Tested by

no test coverage detected