From: Kunal Sinha Date: Thu, 6 Jun 2013 12:41:59 +0000 (+0530) Subject: Fix for Scroll to cursor Accessibility element X-Git-Tag: accepted/tizen/20130924.144426~1^2~650^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba8d125f56bc2ac1543b92986661a1efd557ca6f;p=platform%2Fframework%2Fnative%2Fuifw.git Fix for Scroll to cursor Accessibility element Change-Id: I568f1c68852f5fb93752c945945ea150bf07ea66 Signed-off-by: Kunal Sinha --- 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);