Rename variable so it is clear what is measured (bytes).

This commit is contained in:
Michael Lotz
2011-12-06 19:13:26 +01:00
parent dd26f81c56
commit 9f65f3dd66
+7 -7
View File
@@ -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)