Merge "Ensure cursor positioned at end of selection when focus restored" into devel...
authorPaul Wisbey <p.wisbey@samsung.com>
Thu, 20 Aug 2015 13:50:04 +0000 (06:50 -0700)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Thu, 20 Aug 2015 13:50:04 +0000 (06:50 -0700)
1  2 
dali-toolkit/internal/text/text-controller-impl.cpp

@@@ -1053,6 -1053,9 +1053,9 @@@ void Controller::Impl::RepositionSelect
  
    mEventData->mDecorator->SetPosition( RIGHT_SELECTION_HANDLE, secondaryPosition.x, secondaryPosition.y, secondaryCursorInfo.lineHeight );
  
+   // Cursor to be positioned at end of selection so if selection interrupted and edit mode restarted the cursor will be at end of selection
+   mEventData->mPrimaryCursorPosition = (indicesSwapped)?mEventData->mLeftSelectionPosition:mEventData->mRightSelectionPosition;
    // Set the flag to update the decorator.
    mEventData->mDecoratorUpdated = true;
  }
@@@ -1709,7 -1712,7 +1712,7 @@@ void Controller::Impl::UpdateCursorPosi
      return;
    }
  
 -  if( IsShowingPlaceholderText() )
 +  if( IsShowingPlaceholderText() || ( 0u == mLogicalModel->mText.Count() ) )
    {
      // Do not want to use the place-holder text to set the cursor position.