X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-controller-impl.cpp;h=00c666e05cc40d5f746cb326f29ab550ff9a2f11;hp=49b8f3d0c9720bdbc07de2c13923b470371d0e98;hb=b65b76178d928c38e88181fcb52c5fa2fd590036;hpb=2d2ecb83398d1c811911b8a734fb844a16616636 diff --git a/dali-toolkit/internal/text/text-controller-impl.cpp b/dali-toolkit/internal/text/text-controller-impl.cpp index 49b8f3d..00c666e 100644 --- a/dali-toolkit/internal/text/text-controller-impl.cpp +++ b/dali-toolkit/internal/text/text-controller-impl.cpp @@ -455,44 +455,33 @@ void Controller::Impl::OnCursorKeyEvent( const Event& event ) void Controller::Impl::OnTapEvent( const Event& event ) { - if( NULL == mEventData ) + if( NULL != mEventData ) { - // Nothing to do if there is no text input. - return; - } + const unsigned int tapCount = event.p1.mUint; - const unsigned int tapCount = event.p1.mUint; - - if( 1u == tapCount ) - { - // Grab handle is not shown until a tap is received whilst EDITING - if( EventData::EDITING == mEventData->mState && - !IsShowingPlaceholderText() ) + if( 1u == tapCount ) { - if( mEventData->mGrabHandleEnabled ) + if( ! IsShowingPlaceholderText() ) { - mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, true ); - } - mEventData->mDecorator->SetPopupActive( false ); - } - - ChangeState( EventData::EDITING ); - - const float xPosition = event.p2.mFloat - mEventData->mScrollPosition.x - mAlignmentOffset.x; - const float yPosition = event.p3.mFloat - mEventData->mScrollPosition.y - mAlignmentOffset.y; - - mEventData->mPrimaryCursorPosition = GetClosestCursorIndex( xPosition, - yPosition ); + const float xPosition = event.p2.mFloat - mEventData->mScrollPosition.x - mAlignmentOffset.x; + const float yPosition = event.p3.mFloat - mEventData->mScrollPosition.y - mAlignmentOffset.y; - mEventData->mUpdateCursorPosition = true; - mEventData->mScrollAfterUpdateCursorPosition = true; - } - else if( mEventData->mSelectionEnabled && - ( 2u == tapCount ) ) - { - ChangeState( EventData::SELECTING ); + mEventData->mPrimaryCursorPosition = GetClosestCursorIndex( xPosition, + yPosition ); + } + else + { + mEventData->mPrimaryCursorPosition = 0u; + } - RepositionSelectionHandles( event.p2.mFloat, event.p3.mFloat ); + mEventData->mUpdateCursorPosition = true; + mEventData->mScrollAfterUpdateCursorPosition = true; + } + else if( mEventData->mSelectionEnabled && + ( 2u == tapCount ) ) + { + RepositionSelectionHandles( event.p2.mFloat, event.p3.mFloat ); + } } }