* 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,6 +2799,10 @@ 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;
|
||||||
|
|
||||||
|
if (fWrap)
|
||||||
|
fLayoutData->preferred.width = min.width + 5 * lineHeight;
|
||||||
|
else {
|
||||||
float maxWidth = 0;
|
float maxWidth = 0;
|
||||||
for (int i = 0; i < fLines->NumLines(); i++) {
|
for (int i = 0; i < fLines->NumLines(); i++) {
|
||||||
float width = LineWidth(0);
|
float width = LineWidth(0);
|
||||||
@@ -2810,6 +2814,7 @@ BTextView::_ValidateLayoutData()
|
|||||||
|
|
||||||
fLayoutData->preferred.width
|
fLayoutData->preferred.width
|
||||||
= maxWidth + fLayoutData->leftInset + fLayoutData->rightInset;
|
= maxWidth + fLayoutData->leftInset + fLayoutData->rightInset;
|
||||||
|
}
|
||||||
|
|
||||||
fLayoutData->valid = true;
|
fLayoutData->valid = true;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user