summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2017-07-10 19:48:41 +0300
committerandreykproductengine <andreykproductengine@lindenlab.com>2017-07-10 19:48:41 +0300
commit36235df02d1fe5860371853472e04b4221bea3cd (patch)
tree871b624576540e2bf6c45af557bbbd825ef1400d /indra/llui
parent6bc2c5789cfedee024d6eb8d33972bfa713ce3fc (diff)
MAINT-7576 Fixed scroll zone being too small and hardcoded
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llscrollcontainer.cpp6
-rw-r--r--indra/llui/llscrollcontainer.h2
2 files changed, 6 insertions, 2 deletions
diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp
index 770315fadd..6135cc56ad 100644
--- a/indra/llui/llscrollcontainer.cpp
+++ b/indra/llui/llscrollcontainer.cpp
@@ -72,6 +72,7 @@ LLScrollContainer::Params::Params()
hide_scrollbar("hide_scrollbar"),
min_auto_scroll_rate("min_auto_scroll_rate", 100),
max_auto_scroll_rate("max_auto_scroll_rate", 1000),
+ max_auto_scroll_zone("max_auto_scroll_zone", 16),
reserve_scroll_corner("reserve_scroll_corner", false),
size("size", -1)
{}
@@ -88,6 +89,7 @@ LLScrollContainer::LLScrollContainer(const LLScrollContainer::Params& p)
mReserveScrollCorner(p.reserve_scroll_corner),
mMinAutoScrollRate(p.min_auto_scroll_rate),
mMaxAutoScrollRate(p.max_auto_scroll_rate),
+ mMaxAutoScrollZone(p.max_auto_scroll_zone),
mScrolledView(NULL),
mSize(p.size)
{
@@ -332,8 +334,8 @@ bool LLScrollContainer::autoScroll(S32 x, S32 y, bool do_scroll)
S32 auto_scroll_speed = ll_round(mAutoScrollRate * LLFrameTimer::getFrameDeltaTimeF32());
// autoscroll region should take up no more than one third of visible scroller area
- S32 auto_scroll_region_width = llmin(inner_rect_local.getWidth() / 3, 10);
- S32 auto_scroll_region_height = llmin(inner_rect_local.getHeight() / 3, 10);
+ S32 auto_scroll_region_width = llmin(inner_rect_local.getWidth() / 3, (S32)mMaxAutoScrollZone);
+ S32 auto_scroll_region_height = llmin(inner_rect_local.getHeight() / 3, (S32)mMaxAutoScrollZone);
if( mScrollbar[HORIZONTAL]->getVisible() )
{
diff --git a/indra/llui/llscrollcontainer.h b/indra/llui/llscrollcontainer.h
index a2f7d14f1a..e6c7891397 100644
--- a/indra/llui/llscrollcontainer.h
+++ b/indra/llui/llscrollcontainer.h
@@ -66,6 +66,7 @@ public:
hide_scrollbar;
Optional<F32> min_auto_scroll_rate,
max_auto_scroll_rate;
+ Optional<U32> max_auto_scroll_zone;
Optional<LLUIColor> bg_color;
Optional<LLScrollbar::callback_t> scroll_callback;
Optional<S32> size;
@@ -143,6 +144,7 @@ private:
F32 mAutoScrollRate;
F32 mMinAutoScrollRate;
F32 mMaxAutoScrollRate;
+ U32 mMaxAutoScrollZone;
bool mHideScrollbar;
};