MCPcopy
hub / github.com/HumanSignal/label-studio / wrappedLineExtent

Function wrappedLineExtent

docs/themes/htx/source/js/codemirror.js:3768–3786  ·  view source on GitHub ↗
(cm, lineObj, preparedMeasure, y)

Source from the content-addressed store, hash-verified

3766 }
3767
3768 function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {
3769 y -= widgetTopHeight(lineObj);
3770 var end = lineObj.text.length;
3771 var begin = findFirst(
3772 function(ch) {
3773 return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y;
3774 },
3775 end,
3776 0,
3777 );
3778 end = findFirst(
3779 function(ch) {
3780 return measureCharPrepared(cm, preparedMeasure, ch).top > y;
3781 },
3782 begin,
3783 end,
3784 );
3785 return { begin: begin, end: end };
3786 }
3787
3788 function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {
3789 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