| 1850 | } |
| 1851 | |
| 1852 | static 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 | |
| 1870 | static int WidestLineWidth ( Surface *surface, ViewStyle &vs, int styleOffset, const StyledText &st ) |
| 1871 | { |
no test coverage detected