From ba8d125f56bc2ac1543b92986661a1efd557ca6f Mon Sep 17 00:00:00 2001 From: Kunal Sinha Date: Thu, 6 Jun 2013 18:11:59 +0530 Subject: [PATCH] Fix for Scroll to cursor Accessibility element Change-Id: I568f1c68852f5fb93752c945945ea150bf07ea66 Signed-off-by: Kunal Sinha --- src/ui/controls/FUiCtrl_TokenEditPresenter.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ui/controls/FUiCtrl_TokenEditPresenter.cpp b/src/ui/controls/FUiCtrl_TokenEditPresenter.cpp index f450b93..1d10904 100644 --- a/src/ui/controls/FUiCtrl_TokenEditPresenter.cpp +++ b/src/ui/controls/FUiCtrl_TokenEditPresenter.cpp @@ -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); -- 2.7.4