From 7c4c849d4ed533656cfa8cbf16434ed8738ff554 Mon Sep 17 00:00:00 2001 From: Seongjun Yim Date: Wed, 15 May 2013 23:27:56 +0900 Subject: [PATCH] fix bug for APIs using coordinate Change-Id: Iaebe6ba998e9628679c3cf1901b9704570eca67f Signed-off-by: Seongjun Yim --- src/controls/FWebCtrl_WebImpl.cpp | 40 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/src/controls/FWebCtrl_WebImpl.cpp b/src/controls/FWebCtrl_WebImpl.cpp index 000dcdd..d37deec 100755 --- a/src/controls/FWebCtrl_WebImpl.cpp +++ b/src/controls/FWebCtrl_WebImpl.cpp @@ -72,6 +72,7 @@ #include #include #include +#include #include #include #include @@ -2876,6 +2877,15 @@ _WebImpl::GetSetting(void) const const HitElementResult* _WebImpl::GetElementByPointN(const Point& point) const { + return GetElementByPointN(_CoordinateSystemUtils::ConvertToFloat(point)); +} + + +const HitElementResult* +_WebImpl::GetElementByPointN(const FloatPoint& point) const +{ + SysTryReturn(NID_WEB_CTRL, Contains(point), null, E_INVALID_ARG, "[%s] The point must be contained in the bounds of a web control.", GetErrorMessage(E_INVALID_ARG)); + result r = E_SUCCESS; _HitElementResultImpl* pHitElementResultImpl = null; @@ -2884,7 +2894,7 @@ _WebImpl::GetElementByPointN(const Point& point) const std::unique_ptr pImage; std::unique_ptr pAttributeMap; - Point absPoint(__pWebCore->GetAbsoluteCoordinate(point)); + Point absPoint(_CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(point))); Ewk_Hit_Test* pEwkHitTest = ewk_view_hit_test_new(__pWebCore->GetWebNativeNode(), absPoint.x, absPoint.y, EWK_HIT_TEST_MODE_ALL); SysTryReturn(NID_WEB_CTRL, pEwkHitTest, null, E_SYSTEM, "[%s] Failed to get hit test.", GetErrorMessage(E_SYSTEM)); @@ -2978,18 +2988,6 @@ CATCH: } -const HitElementResult* -_WebImpl::GetElementByPointN(const FloatPoint& point) const -{ - const Point integerPoint(_CoordinateSystemUtils::ConvertToInteger(point)); - - std::unique_ptr pHitElementResult(GetElementByPointN(integerPoint)); - SysTryReturn(NID_WEB_CTRL, pHitElementResult.get(), null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); - - return pHitElementResult.release(); -} - - bool _WebImpl::IsLoading(void) const { @@ -3547,12 +3545,19 @@ _WebImpl::RemoveEventListenerCallback(void) const result _WebImpl::SetBlockSelectionPosition(const Point& startPoint) { + return SetBlockSelectionPosition(_CoordinateSystemUtils::ConvertToFloat(startPoint)); +} + + +result +_WebImpl::SetBlockSelectionPosition(const FloatPoint& startPoint) +{ Evas_Object* pWebNativeNode = __pWebCore->GetWebNativeNode(); Ewk_View_Smart_Data* pSmartData = (Ewk_View_Smart_Data*) evas_object_smart_data_get(pWebNativeNode); SysAssertf(pSmartData, "Failed to request"); - Point absPoint(__pWebCore->GetAbsoluteCoordinate(startPoint)); + Point absPoint( _CoordinateSystemUtils::ConvertToInteger(__pWebCore->GetAbsoluteCoordinate(startPoint))); Eina_Bool ret = pSmartData->api->text_selection_down(pSmartData, absPoint.x, absPoint.y); if (ret) @@ -3585,13 +3590,6 @@ _WebImpl::SetBlockSelectionPosition(const Point& startPoint) } -result -_WebImpl::SetBlockSelectionPosition(const FloatPoint& startPoint) -{ - return SetBlockSelectionPosition(_CoordinateSystemUtils::ConvertToInteger(startPoint)); -} - - void _WebImpl::ReleaseBlock(void) { -- 2.7.4