MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / scrollToCoordsRange

Function scrollToCoordsRange

lib/web/CodeMirror/src/display/scrolling.js:148–156  ·  view source on GitHub ↗
(cm, from, to, margin)

Source from the content-addressed store, hash-verified

146}
147
148export 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.

Callers 2

methods.jsFile · 0.90
resolveScrollToPosFunction · 0.70

Calls 4

calculateScrollPosFunction · 0.70
scrollToCoordsFunction · 0.70
minMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected