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

Function wrappedLineExtent

external/.scrollLibs.js:4099–4117  ·  view source on GitHub ↗
(cm, lineObj, preparedMeasure, y)

Source from the content-addressed store, hash-verified

4097 }
4098
4099 function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {
4100 y -= widgetTopHeight(lineObj)
4101 var end = lineObj.text.length
4102 var begin = findFirst(
4103 function (ch) {
4104 return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y
4105 },
4106 end,
4107 0
4108 )
4109 end = findFirst(
4110 function (ch) {
4111 return measureCharPrepared(cm, preparedMeasure, ch).top > y
4112 },
4113 begin,
4114 end
4115 )
4116 return { begin: begin, end: end }
4117 }
4118
4119 function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {
4120 if (!preparedMeasure) {

Callers 2

wrappedLineExtentCharFunction · 0.85
coordsBidiPartWrappedFunction · 0.85

Calls 3

widgetTopHeightFunction · 0.85
findFirstFunction · 0.85
measureCharPreparedFunction · 0.85

Tested by

no test coverage detected