Text area width needs to be recalculated if vertical scrollbar changes visibility.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9094 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Matthias Melcher 2011-09-30 10:20:09 +00:00
parent 41876bf00a
commit 7446a4d5bb

View File

@ -295,6 +295,7 @@ void Fl_Text_Display::resize(int X, int Y, int W, int H) {
text_area.y = Y+TOP_MARGIN;
text_area.w = W-LEFT_MARGIN-RIGHT_MARGIN;
text_area.h = H-TOP_MARGIN-BOTTOM_MARGIN;
const int oldTAWidth = text_area.w;
int i;
/* Find the new maximum font height for this text display */
@ -341,6 +342,7 @@ void Fl_Text_Display::resize(int X, int Y, int W, int H) {
// figure the scrollbars
if (scrollbar_width()) {
/* Decide if the vertical scrollbar needs to be visible */
int vbvis = mVScrollBar->visible();
if (scrollbar_align() & (FL_ALIGN_LEFT|FL_ALIGN_RIGHT) &&
mNBufferLines >= mNVisibleLines - 1)
{
@ -357,6 +359,7 @@ void Fl_Text_Display::resize(int X, int Y, int W, int H) {
scrollbar_width(), text_area.h+TOP_MARGIN+BOTTOM_MARGIN);
}
}
if (vbvis != mVScrollBar->visible()) again = 1;
/*
Decide if the horizontal scrollbar needs to be visible. If the text