From b70435007947ae4ca6198185602173711314652e Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Fri, 10 Mar 2006 22:35:30 +0000 Subject: [PATCH] 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 --- src/kits/interface/BTextView/TextView.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/kits/interface/BTextView/TextView.cpp b/src/kits/interface/BTextView/TextView.cpp index d003a36303..39b618eb70 100644 --- a/src/kits/interface/BTextView/TextView.cpp +++ b/src/kits/interface/BTextView/TextView.cpp @@ -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()); } }