Fix for Scroll to cursor Accessibility element
authorKunal Sinha <kunal.sinha@samsung.com>
Thu, 6 Jun 2013 12:41:59 +0000 (18:11 +0530)
committerKunal Sinha <kunal.sinha@samsung.com>
Thu, 6 Jun 2013 12:41:59 +0000 (18:11 +0530)
Change-Id: I568f1c68852f5fb93752c945945ea150bf07ea66
Signed-off-by: Kunal Sinha <kunal.sinha@samsung.com>
src/ui/controls/FUiCtrl_TokenEditPresenter.cpp

index f450b93..1d10904 100644 (file)
@@ -4253,13 +4253,18 @@ _TokenEditPresenter::ScrollToFocusedTokenAccessibilityElement(const _Accessibili
        float newScrollValue = 0.0f;
        float tokenTopMargin = 0.0f;
        float tokenBottomMargin = 0.0f;
+       float tokenHeight = 0.0f;
+       float textBoundsAlignValue = 0.0f;
        _ControlOrientation orientation = __pTokenEdit->GetOrientation();
        _AccessibilityElement* pAccessibilityElement = null;
 
        GET_SHAPE_CONFIG(TOKENEDIT::TOP_MARGIN, orientation, tokenTopMargin);
        GET_SHAPE_CONFIG(TOKENEDIT::BOTTOM_MARGIN, orientation, tokenBottomMargin);
+       GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_HEIGHT, orientation, tokenHeight);
 
        FloatRectangle tokenEditRect = __pTokenEdit->GetBoundsF();
+       float textObjectMaxHeight = GetMaxTextHeight();
+       textBoundsAlignValue = (tokenHeight - textObjectMaxHeight) / 2.0f;
 
        pAccessibilityElement = const_cast< _AccessibilityElement* >(&element);
        r = __accessibilityElements.IndexOf(pAccessibilityElement, focusedTokenIndex);
@@ -4286,7 +4291,7 @@ _TokenEditPresenter::ScrollToFocusedTokenAccessibilityElement(const _Accessibili
                        }
                        else
                        {
-                               newScrollValue = focusedTokenPosition - tokenEditRect.height + tokenBottomMargin - __scrollValue;
+                               newScrollValue = focusedTokenPosition - textBoundsAlignValue - tokenEditRect.height + tokenBottomMargin - __scrollValue;
                        }
 
                        r = RecalculateTokenBounds(newScrollValue);