X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Fcursor-helper-functions.cpp;h=d8954187e1ee6c4be518b873a131d6771d044db1;hp=3bfc059e111dd627cdd8036de46dbba5bef761e1;hb=5d397f414305c86782668ecd154d8967ee8396b0;hpb=22451f7abe0230b418d551d9eac0c685273e72f1 diff --git a/dali-toolkit/internal/text/cursor-helper-functions.cpp b/dali-toolkit/internal/text/cursor-helper-functions.cpp index 3bfc059..d895418 100644 --- a/dali-toolkit/internal/text/cursor-helper-functions.cpp +++ b/dali-toolkit/internal/text/cursor-helper-functions.cpp @@ -22,6 +22,8 @@ #include // INTERNAL INCLUDES +#include +#include #include namespace @@ -458,6 +460,19 @@ CharacterIndex GetClosestCursorIndex(VisualModelPtr visualModel, logicalIndex = (bidiLineFetched ? logicalModel->GetLogicalCursorIndex(visualIndex) : visualIndex); + // Handle Emoji clustering for cursor handling: + // Fixing this case: + // - When there is Emoji contains multi unicodes and it is layoutted at the end of line (LineWrap case , is not new line case) + // - Try to click at the center or at the end of Emoji then the cursor appears inside Emoji + // - Example:"FamilyManWomanGirlBoy 👨‍👩‍👧‍👦" + const Script script = logicalModel->GetScript(logicalIndex); + if(IsOneOfEmojiScripts(script)) + { + //TODO: Use this clustering for Emoji cases only. This needs more testing to generalize to all scripts. + CharacterRun emojiClusteredCharacters = RetrieveClusteredCharactersOfCharacterIndex(visualModel, logicalModel, logicalIndex); + logicalIndex = emojiClusteredCharacters.characterIndex; + } + DALI_LOG_INFO(gLogFilter, Debug::Verbose, "closest visualIndex %d logicalIndex %d\n", visualIndex, logicalIndex); DALI_ASSERT_DEBUG((logicalIndex <= logicalModel->mText.Count() && logicalIndex >= 0) && "GetClosestCursorIndex - Out of bounds index");