Add the textrect border width to the total width of the control when in autoresize mode
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16693 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
31c533d926
commit
b704350079
@ -4010,7 +4010,7 @@ BTextView::UpdateScrollbars()
|
||||
/*! \brief Autoresizes the view to fit the contained text.
|
||||
*/
|
||||
void
|
||||
BTextView::AutoResize(bool doredraw)
|
||||
BTextView::AutoResize(bool redraw)
|
||||
{
|
||||
if (fResizable) {
|
||||
float width = 0;
|
||||
@ -4018,10 +4018,14 @@ BTextView::AutoResize(bool doredraw)
|
||||
width = max_c(width, LineWidth(i));
|
||||
|
||||
float textRectPadding = Bounds().right - fTextRect.right;
|
||||
width += fTextRect.left + textRectPadding;
|
||||
|
||||
BView *viewToResize = fContainerView != NULL ? fContainerView : this;
|
||||
viewToResize->ResizeTo(width, max_c(Bounds().Height(), TextHeight(0, CountLines())));
|
||||
|
||||
fTextRect.right = Bounds().right - textRectPadding;
|
||||
if (redraw)
|
||||
DrawLines(0, CountLines());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user