From c70dcbddf8833dc00eb5a384b9c281c2b2d41d74 Mon Sep 17 00:00:00 2001 From: SungHee Kim Date: Wed, 8 May 2013 15:04:32 +0900 Subject: [PATCH] [N_SE-37289] If _FastScroll fails to find an selected index in omitted indexes, it holds the previous index without updating. Change-Id: I81c942a467f05c7670f2785594b193ab5525ace8 Signed-off-by: SungHee Kim --- src/ui/controls/FUiCtrl_FastScrollPresenter.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/ui/controls/FUiCtrl_FastScrollPresenter.cpp b/src/ui/controls/FUiCtrl_FastScrollPresenter.cpp index c624625..9c7f7aa 100644 --- a/src/ui/controls/FUiCtrl_FastScrollPresenter.cpp +++ b/src/ui/controls/FUiCtrl_FastScrollPresenter.cpp @@ -445,7 +445,7 @@ _FastScrollIndexView::GetOmissionIndexAtPoint(_FastScrollIndex* pIndex, const Fl float indexHeight = GetIndexHeight() / pIndex->GetChildCount(); int omissionIndexOrder = 0; - if (!(_FloatCompare(touchY, 0.0f) || _FloatCompare(indexHeight, 0.0f))) + if ((touchY > 0.0f) && !_FloatCompare(indexHeight, 0.0f)) { omissionIndexOrder = _CoordinateSystemUtils::ConvertToInteger(touchY / indexHeight); } @@ -554,6 +554,11 @@ _FastScrollIndexView::GetSelectedIndex(void) const void _FastScrollIndexView::SetSelectedIndexInOmittedIndex(_FastScrollIndex* pIndex) { + if (pIndex == __pSelectedIndexInOmittedIndex) + { + return; + } + __pFormerIndex = __pSelectedIndexInOmittedIndex; __pSelectedIndexInOmittedIndex = pIndex; } @@ -2703,6 +2708,10 @@ _FastScrollPresenter::SelectOnIndexViews(const FloatPoint& point, bool animation { pSelectedIndex = pFocusedIndexView->GetOmissionIndexAtPoint(pIndex, FloatPoint(pFocusedIndexView->GetIndexBoundsF().x, point.y)); + if (pSelectedIndex == null) + { + pSelectedIndex = pFocusedIndexView->GetSelectedIndexInOmittedIndex(); + } } pFocusedIndexView->SetSelectedIndexInOmittedIndex(pSelectedIndex); @@ -2711,6 +2720,10 @@ _FastScrollPresenter::SelectOnIndexViews(const FloatPoint& point, bool animation else { pSelectedIndex = pFocusedIndexView->GetSelectedIndex(); + if (pSelectedIndex && pSelectedIndex->GetOmitted() == true) + { + pSelectedIndex = pFocusedIndexView->GetSelectedIndexInOmittedIndex(); + } selectedIndexLevel = __focusedIndexLevel; } } -- 2.7.4