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

Function getDimensions

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

Source from the content-addressed store, hash-verified

706 // Do a bulk-read of the DOM positions and sizes needed to draw the
707 // view, so that we don't interleave reading and writing to the DOM.
708 function getDimensions(cm) {
709 var d = cm.display, left = {}, width = {};
710 for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {
711 left[cm.options.gutters[i]] = n.offsetLeft;
712 width[cm.options.gutters[i]] = n.offsetWidth;
713 }
714 return {fixedPos: compensateForHScroll(d),
715 gutterTotalWidth: d.gutters.offsetWidth,
716 gutterLeft: left,
717 gutterWidth: width,
718 wrapperWidth: d.wrapper.clientWidth};
719 }
720
721 // Sync the actual display DOM structure with display.view, removing
722 // nodes for lines that are no longer in view, and creating the ones

Callers 2

updateDisplayInnerFunction · 0.85
prepareMeasureForLineFunction · 0.85

Calls 1

compensateForHScrollFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…