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 <bowon.ryu@samsung.com>
eventData->mUpdateCursorPosition = false;
eventData->mUpdateGrabHandlePosition = false;
}
- else
+
+ if(eventData->mUpdateHighlightBox ||
+ eventData->mUpdateLeftSelectionPosition ||
+ eventData->mUpdateRightSelectionPosition)
{
CursorInfo leftHandleInfo;
CursorInfo rightHandleInfo;