summaryrefslogtreecommitdiff
path: root/indra/llui/llscrollcontainer.cpp
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2012-04-03 11:06:33 -0700
committerTodd Stinson <stinson@lindenlab.com>2012-04-03 11:06:33 -0700
commit36a0a58487063152d8aacdeb22060025fe0021c7 (patch)
tree58a59dee2b88e1e51391987b157a37b3c8cd710b /indra/llui/llscrollcontainer.cpp
parent8b5b0ace9bfb83540fbc73376b639180d6d63a3b (diff)
parentfa6add3fcd300b21142e3381f35851b3404ee02a (diff)
Pull and merge from ssh://hg@bitbucket.org/lindenlab/viewer-development.
Diffstat (limited to 'indra/llui/llscrollcontainer.cpp')
-rw-r--r--indra/llui/llscrollcontainer.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp
index 20bed050ad..9b7e30bb04 100644
--- a/indra/llui/llscrollcontainer.cpp
+++ b/indra/llui/llscrollcontainer.cpp
@@ -389,10 +389,17 @@ void LLScrollContainer::calcVisibleSize( S32 *visible_width, S32 *visible_height
{
*show_h_scrollbar = TRUE;
*visible_height -= scrollbar_size;
- // Note: Do *not* recompute *show_v_scrollbar here because with
- // the (- scrollbar_size) we just did we will always add a vertical scrollbar
- // even if the height of the items is actually less than the visible size.
- // Fear not though: there's enough calcVisibleSize() calls to add a vertical slider later.
+
+ // The view inside the scroll container should not be extended
+ // to container's full height to ensure the correct computation
+ // of *show_v_scrollbar after subtracting horizontal scrollbar_size.
+
+ // Must retest now that visible_height has changed
+ if( !*show_v_scrollbar && ((doc_height - *visible_height) > 1) )
+ {
+ *show_v_scrollbar = TRUE;
+ *visible_width -= scrollbar_size;
+ }
}
}
}