Better name: result becomes lines.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21348 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -259,10 +259,11 @@ Message::Draw(BView *view, int32 frame)
|
|||||||
font.GetHeight(&fontHeight);
|
font.GetHeight(&fontHeight);
|
||||||
float lineHeight = fontHeight.ascent + fontHeight.descent + fontHeight.leading;
|
float lineHeight = fontHeight.ascent + fontHeight.descent + fontHeight.leading;
|
||||||
|
|
||||||
BString **result = NULL;
|
BString **lines = NULL;
|
||||||
int longestLine = 0;
|
int longestLine = 0;
|
||||||
int count = get_lines(origMessage, &result, &longestLine);
|
int count = get_lines(origMessage, &lines, &longestLine);
|
||||||
float stringWidth = font.StringWidth(result[longestLine]->String());
|
|
||||||
|
float stringWidth = font.StringWidth(lines[longestLine]->String());
|
||||||
BRect box(0, 0, stringWidth + 20, (lineHeight * count) + 20);
|
BRect box(0, 0, stringWidth + 20, (lineHeight * count) + 20);
|
||||||
box.OffsetTo((width - box.Width()) / 2, height - box.Height() - 40);
|
box.OffsetTo((width - box.Width()) / 2, height - box.Height() - 40);
|
||||||
|
|
||||||
@@ -275,11 +276,11 @@ Message::Draw(BView *view, int32 frame)
|
|||||||
start.x += 10;
|
start.x += 10;
|
||||||
start.y += 10 + fontHeight.ascent + fontHeight.leading;
|
start.y += 10 + fontHeight.ascent + fontHeight.leading;
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
offscreen.DrawString(result[i]->String(), start);
|
offscreen.DrawString(lines[i]->String(), start);
|
||||||
start.y += lineHeight;
|
start.y += lineHeight;
|
||||||
delete result[i];
|
delete lines[i];
|
||||||
}
|
}
|
||||||
delete[] result;
|
delete[] lines;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete origMessage;
|
delete origMessage;
|
||||||
|
|||||||
Reference in New Issue
Block a user