MCPcopy
hub / github.com/DHTMLX/gantt / prepareMeasureForLine

Function prepareMeasureForLine

samples/common/codehighlight/codemirror.js:2387–2405  ·  view source on GitHub ↗
(cm, line)

Source from the content-addressed store, hash-verified

2385 // measurements in a row, can thus ensure that the set-up work is
2386 // only done once.
2387 function prepareMeasureForLine(cm, line) {
2388 var lineN = lineNo(line);
2389 var view = findViewForLine(cm, lineN);
2390 if (view && !view.text) {
2391 view = null;
2392 } else if (view && view.changes) {
2393 updateLineForChanges(cm, view, lineN, getDimensions(cm));
2394 cm.curOp.forceUpdate = true;
2395 }
2396 if (!view)
2397 { view = updateExternalMeasurement(cm, line); }
2398
2399 var info = mapFromLineView(view, line, lineN);
2400 return {
2401 line: line, view: view, rect: null,
2402 map: info.map, cache: info.cache, before: info.before,
2403 hasHeights: false
2404 }
2405 }
2406
2407 // Given a prepared measurement object, measures the position of an
2408 // actual character (or fetches it from the cache).

Callers 6

measureCharFunction · 0.85
cursorCoordsFunction · 0.85
wrappedLineExtentCharFunction · 0.85
coordsCharInnerFunction · 0.85
endOfLineFunction · 0.85
getWrappedLineExtentFunction · 0.85

Calls 6

lineNoFunction · 0.85
findViewForLineFunction · 0.85
updateLineForChangesFunction · 0.85
getDimensionsFunction · 0.85
mapFromLineViewFunction · 0.85

Tested by

no test coverage detected