* Only use the new preferred computation method if word wrap is disabled, or
else this won't work as is (this is something that could be done, better, though). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32077 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -2799,17 +2799,22 @@ BTextView::_ValidateLayoutData()
|
|||||||
// compute our preferred size
|
// compute our preferred size
|
||||||
fLayoutData->preferred.height = fTextRect.Height()
|
fLayoutData->preferred.height = fTextRect.Height()
|
||||||
+ fLayoutData->topInset + fLayoutData->bottomInset;
|
+ 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
|
if (fWrap)
|
||||||
= maxWidth + fLayoutData->leftInset + fLayoutData->rightInset;
|
fLayoutData->preferred.width = min.width + 5 * lineHeight;
|
||||||
|
else {
|
||||||
|
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;
|
fLayoutData->valid = true;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user