From: Agnelo Vaz Date: Wed, 12 Aug 2015 14:59:55 +0000 (+0100) Subject: Ensure cursor positioned at end of selection when focus restored X-Git-Tag: dali_1.1.1~10^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=99d47f47e74268c6b58e3a62f875d4757340d82d 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 --- 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; }