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

Function getDimensions

external/.scrollLibs.js:4327–4337  ·  view source on GitHub ↗
(cm)

Source from the content-addressed store, hash-verified

4325 // Do a bulk-read of the DOM positions and sizes needed to draw the
4326 // view, so that we don't interleave reading and writing to the DOM.
4327 function getDimensions(cm) {
4328 var d = cm.display,
4329 left = {},
4330 width = {}
4331 var gutterLeft = d.gutters.clientLeft
4332 for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {
4333 left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft
4334 width[cm.options.gutters[i]] = n.clientWidth
4335 }
4336 return { fixedPos: compensateForHScroll(d), gutterTotalWidth: d.gutters.offsetWidth, gutterLeft: left, gutterWidth: width, wrapperWidth: d.wrapper.clientWidth }
4337 }
4338
4339 // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,
4340 // but using getBoundingClientRect to get a sub-pixel-accurate

Callers 3

prepareMeasureForLineFunction · 0.85
DisplayUpdateFunction · 0.85
updateDisplayIfNeededFunction · 0.85

Calls 1

compensateForHScrollFunction · 0.85

Tested by

no test coverage detected