* The preferred size is now actually the preferred size - the size that is

needed to show all of the text view's contents. No idea what the previous
  solution was about.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32075 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2009-08-03 14:35:27 +00:00
parent 255c9104e5
commit 0b1db200df

View File

@ -2797,9 +2797,19 @@ BTextView::_ValidateLayoutData()
fLayoutData->min = min;
// compute our preferred size
fLayoutData->preferred = min;
fLayoutData->preferred.width += lineHeight * 6;
fLayoutData->preferred.height += lineHeight * 2;
fLayoutData->preferred.height = fTextRect.Height()
+ fLayoutData->topInset + fLayoutData->bottomInset;
float maxWidth = 0;
for (int i = 0; i < fLines->NumLines(); i++) {
float width = LineWidth(0);
if (maxWidth < width)
maxWidth = width;
}
if (maxWidth < min.width)
maxWidth = min.width;
fLayoutData->preferred.width
= maxWidth + fLayoutData->leftInset + fLayoutData->rightInset;
fLayoutData->valid = true;