From: Bowon Ryu Date: Fri, 28 May 2021 08:17:00 +0000 (+0900) Subject: Fixed invalid text selection behaviour X-Git-Tag: dali_2.0.29~4^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=7fe4f51894c4c9f158e64b3d11d5d9c8ebdbf990 Fixed invalid text selection behaviour This patch fixes an issue where selection handles are not updated. (issue of visual update, not value) // test case textField.SetProperty(DevelTextField::Property::PRIMARY_CURSOR_POSITION, 5); textField.SetProperty(DevelTextField::Property::SELECTED_TEXT_START, 5); textField.SetProperty(DevelTextField::Property::SELECTED_TEXT_END, 10); In the test case above, the selection handle is not updated. * Internal flag status when PRIMARY_CURSOR_POSITION is set : in SetPrimaryCursorPosition(), mUpdateCursorPosition = true; * Internal flag status when SELECTED_TEXT_START, SELECTED_TEXT_END is set : in SetTextSelectionRange(), mUpdateHighlightBox = true; mUpdateLeftSelectionPosition = true; mUpdateRightSelectionPosition = true; By the way, the actual updates such as cursor, selection, grab handle, are handled at once in ProcessInputEvents() based on the flags above. In the test case, since mUpdateCursorPosition is true, "else" can not be reached. That's why the selection handle doesn't update. This issue is solved by fixing conditional statement. Also due to this patch, Issues arising from mPrimaryCursorPosition inside SetTextSelectionRange() are also resolved. Change-Id: I77890fd3744406a885325e53e2354c1ac9d454d6 Signed-off-by: Bowon Ryu --- diff --git a/dali-toolkit/internal/text/text-controller-impl-event-handler.cpp b/dali-toolkit/internal/text/text-controller-impl-event-handler.cpp index 22525db..29f6ba3 100644 --- a/dali-toolkit/internal/text/text-controller-impl-event-handler.cpp +++ b/dali-toolkit/internal/text/text-controller-impl-event-handler.cpp @@ -155,7 +155,10 @@ bool ControllerImplEventHandler::ProcessInputEvents(Controller::Impl& impl) eventData->mUpdateCursorPosition = false; eventData->mUpdateGrabHandlePosition = false; } - else + + if(eventData->mUpdateHighlightBox || + eventData->mUpdateLeftSelectionPosition || + eventData->mUpdateRightSelectionPosition) { CursorInfo leftHandleInfo; CursorInfo rightHandleInfo;