added +1 to the textrect width in AutoResize(). Maybe it needs still more space. Fixes bug 764.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18584 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2006-08-23 10:11:44 +00:00
parent 3e16073da7
commit a8945c367b

View File

@ -1991,6 +1991,11 @@ BTextView::ScrollToOffset(int32 inOffset)
float lineHeight = 0.0;
BPoint point = PointAt(inOffset, &lineHeight);
// TODO: We should do the following, since otherwise the textview
// won't scroll unless it's attached to a scrollview.
/*if (!bounds.Contains(point))
ScrollTo(point); */
if (ScrollBar(B_HORIZONTAL) != NULL) {
if (point.x < bounds.left || point.x >= bounds.right)
ScrollBar(B_HORIZONTAL)->SetValue(point.x - (bounds.IntegerWidth() / 2));
@ -4016,7 +4021,7 @@ BTextView::AutoResize(bool redraw)
for (int32 i = 0; i < CountLines(); i++)
newWidth += LineWidth(i);
BRect newRect(0, 0, ceilf(newWidth), ceilf(TextHeight(0, 0)) + 1);
BRect newRect(0, 0, ceilf(newWidth) + 1, ceilf(TextHeight(0, 0)) + 1);
if (fContainerView != NULL) {
fContainerView->ResizeTo(newRect.Width(), newRect.Height());