MCPcopy Index your code
hub / github.com/csev/py4e / getDimensions

Function getDimensions

tools/pythonauto/static/codemirrorepl/codemirror.js:693–704  ·  view source on GitHub ↗
(cm)

Source from the content-addressed store, hash-verified

691 // Do a bulk-read of the DOM positions and sizes needed to draw the
692 // view, so that we don't interleave reading and writing to the DOM.
693 function getDimensions(cm) {
694 var d = cm.display, left = {}, width = {};
695 for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {
696 left[cm.options.gutters[i]] = n.offsetLeft;
697 width[cm.options.gutters[i]] = n.offsetWidth;
698 }
699 return {fixedPos: compensateForHScroll(d),
700 gutterTotalWidth: d.gutters.offsetWidth,
701 gutterLeft: left,
702 gutterWidth: width,
703 wrapperWidth: d.wrapper.clientWidth};
704 }
705
706 // Sync the actual display DOM structure with display.view, removing
707 // nodes for lines that are no longer in view, and creating the ones

Callers 2

updateDisplayInnerFunction · 0.70
prepareMeasureForLineFunction · 0.70

Calls 1

compensateForHScrollFunction · 0.70

Tested by

no test coverage detected