MCPcopy Index your code
hub / github.com/witheve/Eve / getDimensions

Function getDimensions

src/codemirror.js:833–845  ·  view source on GitHub ↗
(cm)

Source from the content-addressed store, hash-verified

831 // Do a bulk-read of the DOM positions and sizes needed to draw the
832 // view, so that we don't interleave reading and writing to the DOM.
833 function getDimensions(cm) {
834 var d = cm.display, left = {}, width = {};
835 var gutterLeft = d.gutters.clientLeft;
836 for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {
837 left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;
838 width[cm.options.gutters[i]] = n.clientWidth;
839 }
840 return {fixedPos: compensateForHScroll(d),
841 gutterTotalWidth: d.gutters.offsetWidth,
842 gutterLeft: left,
843 gutterWidth: width,
844 wrapperWidth: d.wrapper.clientWidth};
845 }
846
847 // Sync the actual display DOM structure with display.view, removing
848 // nodes for lines that are no longer in view, and creating the ones

Callers 3

DisplayUpdateFunction · 0.85
updateDisplayIfNeededFunction · 0.85
prepareMeasureForLineFunction · 0.85

Calls 1

compensateForHScrollFunction · 0.85

Tested by

no test coverage detected