MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / WidthStyledText

Function WidthStyledText

scintilla/src/Editor.cxx:1852–1868  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1850}
1851
1852static int WidthStyledText ( Surface *surface, ViewStyle &vs, int styleOffset,
1853 const char *text, const unsigned char *styles, size_t len )
1854{
1855 int width = 0;
1856 size_t start = 0;
1857 while ( start < len ) {
1858 size_t style = styles[start];
1859 size_t endSegment = start;
1860 while ( ( endSegment + 1 < len ) && ( static_cast<size_t> ( styles[endSegment + 1] ) == style ) ) {
1861 endSegment++;
1862 }
1863 width += surface->WidthText ( vs.styles[style + styleOffset].font, text + start,
1864 static_cast<int> ( endSegment - start + 1 ) );
1865 start = endSegment + 1;
1866 }
1867 return width;
1868}
1869
1870static int WidestLineWidth ( Surface *surface, ViewStyle &vs, int styleOffset, const StyledText &st )
1871{

Callers 1

WidestLineWidthFunction · 0.85

Calls 1

WidthTextMethod · 0.80

Tested by

no test coverage detected