Ensure cursor positioned at end of selection when focus restored 72/45972/3
authorAgnelo Vaz <agnelo.vaz@samsung.com>
Wed, 12 Aug 2015 14:59:55 +0000 (15:59 +0100)
committerAgnelo Vaz <agnelo.vaz@samsung.com>
Thu, 20 Aug 2015 13:01:34 +0000 (06:01 -0700)
* If KeyInputFocus is lost during selection then the cursor should be positioned at end of the selection when Focus regained.
* Behaviour set to match other systems

Change-Id: I51fb52df99f6a8131c2f74acf54651667567f62f
Signed-off-by: Agnelo Vaz <agnelo.vaz@samsung.com>
dali-toolkit/internal/text/text-controller-impl.cpp

index 3da7138..2b04538 100644 (file)
@@ -1053,6 +1053,9 @@ void Controller::Impl::RepositionSelectionHandles( CharacterIndex selectionStart
 
   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;
 }