MCPcopy Create free account
hub / github.com/sql-js/sql.js / resolveScrollToPos

Function resolveScrollToPos

GUI/codemirror/lib/codemirror.js:3618–3629  ·  view source on GitHub ↗
(cm)

Source from the content-addressed store, hash-verified

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

Callers 3

addToScrollPosFunction · 0.85
ensureCursorVisibleFunction · 0.85
codemirror.jsFile · 0.85

Calls 2

estimateCoordsFunction · 0.85
calculateScrollPosFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…