From: ANZ1217 Date: Mon, 9 Sep 2024 10:44:12 +0000 (+0900) Subject: [Tizen] Fix the problem that Autoscroll does not work properly X-Git-Tag: accepted/tizen/8.0/unified/20240924.162414^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Faccepted%2Ftizen_8.0_unified;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git [Tizen] Fix the problem that Autoscroll does not work properly when there are only RTL Marker and LTR Text in Text. Change-Id: I644ee6f88367d7f0fe2190ae2425414bbad4a7d9 --- diff --git a/dali-toolkit/internal/text/multi-language-support-impl.cpp b/dali-toolkit/internal/text/multi-language-support-impl.cpp index 1b3d0ce..205424f 100644 --- a/dali-toolkit/internal/text/multi-language-support-impl.cpp +++ b/dali-toolkit/internal/text/multi-language-support-impl.cpp @@ -372,6 +372,10 @@ void MultilanguageSupport::SetScripts(const Vector& text, // Whether the first valid script is a right to left script. bool isParagraphRTL = false; + // Whether there is an RTL marker in the invalid script. + // This variable was added to solve the problem that autoscroll does not work properly when there are only RTL Marker and LTR Text. + bool hasRTLMarker = false; + // Count the number of characters which are valid for all scripts. i.e. white spaces or '\n'. Length numberOfAllScriptCharacters = 0u; @@ -434,6 +438,7 @@ void MultilanguageSupport::SetScripts(const Vector& text, { // Check if whether is right to left markup and Keeps true if the previous value was true. currentScriptRun.isRightToLeft = currentScriptRun.isRightToLeft || TextAbstraction::IsRightToLeftMark(character); + hasRTLMarker = hasRTLMarker || TextAbstraction::IsRightToLeftMark(character); // Count all these characters to be added into a script. ++numberOfAllScriptCharacters; @@ -533,12 +538,14 @@ void MultilanguageSupport::SetScripts(const Vector& text, // Adds the white spaces which are at the begining of the script. numberOfAllScriptCharacters++; AddCurrentScriptAndCreatNewScript(script, - TextAbstraction::IsRightToLeftScript(script), + hasRTLMarker ? true : TextAbstraction::IsRightToLeftScript(script), true, currentScriptRun, numberOfAllScriptCharacters, scripts, scriptIndex); + + hasRTLMarker = false; } else {