From 99d47f47e74268c6b58e3a62f875d4757340d82d Mon Sep 17 00:00:00 2001 From: Agnelo Vaz Date: Wed, 12 Aug 2015 15:59:55 +0100 Subject: [PATCH] Ensure cursor positioned at end of selection when focus restored * 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 --- dali-toolkit/internal/text/text-controller-impl.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dali-toolkit/internal/text/text-controller-impl.cpp b/dali-toolkit/internal/text/text-controller-impl.cpp index 3da7138..2b04538 100644 --- a/dali-toolkit/internal/text/text-controller-impl.cpp +++ b/dali-toolkit/internal/text/text-controller-impl.cpp @@ -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; } -- 2.7.4