Rename variable so it is clear what is measured (bytes).
This commit is contained in:
@@ -4170,8 +4170,8 @@ BTextView::_StyledWidth(int32 fromOffset, int32 length, float* outAscent,
|
|||||||
|
|
||||||
// iterate through the style runs
|
// iterate through the style runs
|
||||||
const BFont *font = NULL;
|
const BFont *font = NULL;
|
||||||
int32 numChars;
|
int32 numBytes;
|
||||||
while ((numChars = fStyles->Iterate(fromOffset, length, fInline, &font,
|
while ((numBytes = fStyles->Iterate(fromOffset, length, fInline, &font,
|
||||||
NULL, &ascent, &descent)) != 0) {
|
NULL, &ascent, &descent)) != 0) {
|
||||||
maxAscent = max_c(ascent, maxAscent);
|
maxAscent = max_c(ascent, maxAscent);
|
||||||
maxDescent = max_c(descent, maxDescent);
|
maxDescent = max_c(descent, maxDescent);
|
||||||
@@ -4180,18 +4180,18 @@ BTextView::_StyledWidth(int32 fromOffset, int32 length, float* outAscent,
|
|||||||
// Use _BWidthBuffer_ if possible
|
// Use _BWidthBuffer_ if possible
|
||||||
if (BPrivate::gWidthBuffer != NULL) {
|
if (BPrivate::gWidthBuffer != NULL) {
|
||||||
result += BPrivate::gWidthBuffer->StringWidth(*fText, fromOffset,
|
result += BPrivate::gWidthBuffer->StringWidth(*fText, fromOffset,
|
||||||
numChars, font);
|
numBytes, font);
|
||||||
} else {
|
} else {
|
||||||
#endif
|
#endif
|
||||||
const char* text = fText->GetString(fromOffset, &numChars);
|
const char* text = fText->GetString(fromOffset, &numBytes);
|
||||||
result += font->StringWidth(text, numChars);
|
result += font->StringWidth(text, numBytes);
|
||||||
|
|
||||||
#if USE_WIDTHBUFFER
|
#if USE_WIDTHBUFFER
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fromOffset += numChars;
|
fromOffset += numBytes;
|
||||||
length -= numChars;
|
length -= numBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (outAscent != NULL)
|
if (outAscent != NULL)
|
||||||
|
|||||||
Reference in New Issue
Block a user