Fix for TDIS-5269
authorSaravana Balaji <saravana.bs@samsung.com>
Wed, 17 Apr 2013 17:06:27 +0000 (22:36 +0530)
committerSaravana Balaji <saravana.bs@samsung.com>
Thu, 18 Apr 2013 08:24:16 +0000 (13:54 +0530)
Change-Id: Id1245434cde907f66ffc7d1bf5acd88f2450c6cb
Signed-off-by: Saravana Balaji <saravana.bs@samsung.com>
src/ui/controls/FUiCtrl_TokenEditPresenter.cpp
src/ui/inc/FUiCtrl_TokenEditPresenter.h

index 8b96ce4..c8c308f 100644 (file)
@@ -299,7 +299,7 @@ _TokenEditPresenter::_TokenEditPresenter(void)
        , __isScrollValueModified(false)
        , __isTouchMoveInProgress(false)
        , __isTitleSliding(false)
-       , __touchPressInfo(Point(-1, -1))
+       , __touchPressInfo(FloatPoint(-1.0f, -1.0f))
        , __editContentFontSize(0.0f)
 {
 }
@@ -2767,23 +2767,33 @@ _TokenEditPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& to
 {
        int tokenIndex = GetTokenIndexFromCoordinate(_CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition()));
 
+       _TouchInfo TouchInfo(touchinfo);
        if (tokenIndex != -1)
        {
                if (tokenIndex == __edittingTokenIndex)
                {
-                       __touchPressInfo.x = _CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition()).x;
-                       __touchPressInfo.y = _CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition()).y;
+                       __touchPressInfo.x = touchinfo.GetCurrentPosition().x;
+                       __touchPressInfo.y = touchinfo.GetCurrentPosition().y;
+
+                       _Token* pToken = null;
+                       pToken = static_cast <_Token*>(__pTokenList->GetAt(__edittingTokenIndex));
+                       if (pToken)
+                       {
+                               float tokenX = pToken->displayRect.x;
+                               float tokenY = pToken->displayRect.y;
+                               FloatPoint point(__touchPressInfo.x - tokenX, __touchPressInfo.y - tokenY);
+                               TouchInfo.SetTouchInfo(touchinfo.GetPointId(), touchinfo.GetTouchStatus(), point, touchinfo.IsFlicked(), touchinfo.GetTimeStamp());
+                       }
                }
-               return false;
        }
 
-       return _EditPresenter::OnTouchPressed(source, touchinfo);
+       return _EditPresenter::OnTouchPressed(source, TouchInfo);
 }
 
 bool
 _TokenEditPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
 {
-       __touchPressInfo = Point(-1, -1);
+       __touchPressInfo = FloatPoint(-1.0f, -1.0f);
 
        ProcessTokeningByTouchEvent(source, touchinfo);
        if (GetTokenCount())
@@ -3428,14 +3438,14 @@ _TokenEditPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touc
                _Token* pToken = null;
                if (__edittingTokenIndex >= 0)
                {
-                       if (__touchPressInfo.y > 0)
+                       if (__touchPressInfo.y > 0.0f)
                        {
                                pToken = static_cast <_Token*>(__pTokenList->GetAt(__edittingTokenIndex));
                                if (pToken)
                                {
-                                       int tokenX = _CoordinateSystemUtils::ConvertToInteger(pToken->displayRect.x);
-                                       int tokenY = _CoordinateSystemUtils::ConvertToInteger(pToken->displayRect.y);
-                                       Point point(_CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition()).x - tokenX, __touchPressInfo.y - tokenY);
+                                       float tokenX = pToken->displayRect.x;
+                                       float tokenY = pToken->displayRect.y;
+                                       FloatPoint point(touchinfo.GetCurrentPosition().x - tokenX, __touchPressInfo.y - tokenY);
                                        TouchInfo.SetTouchInfo(touchinfo.GetPointId(), touchinfo.GetTouchStatus(), point, touchinfo.IsFlicked(), touchinfo.GetTimeStamp());
                                }
 
@@ -3474,7 +3484,7 @@ _TokenEditPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touc
                        }
                }
 
-               return false;           // Event through
+               return _EditPresenter::OnTouchMoved(source, touchinfo);
        }
        else
        {
index 69e894f..b065b45 100644 (file)
@@ -255,7 +255,7 @@ private:
 
        bool __isTitleSliding;
 
-       Tizen::Graphics::Point __touchPressInfo;
+       Tizen::Graphics::FloatPoint __touchPressInfo;
 
        int __editContentFontSize;