[Tizen] bug fixed : Characters are truncated when HorizontalAlignment.End in
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 5 Nov 2018 08:30:18 +0000 (17:30 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 5 Nov 2018 08:30:22 +0000 (17:30 +0900)
This reverts commit 578d08126a5aa647baa4b4f3c1226ea390280c69.

Change-Id: I6f8bbccd6fe0706c26a31c28dee6cd0ba6a72b86

automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Layout.cpp
dali-toolkit/internal/text/layouts/layout-engine.cpp

index bc9d08b..5b67476 100755 (executable)
@@ -5316,7 +5316,7 @@ int UtcDaliTextAlign10(void)
   fontDescriptionRuns.PushBack( fontDescriptionRun05 );
   fontDescriptionRuns.PushBack( fontDescriptionRun06 );
 
-  float positions[] = { -4.f, 0.f, 0.f, 0.f, 0.f, 0.f };
+  float positions[] = { 0.f, 0.f, 0.f, 0.f, 0.f, 0.f };
 
   Size textArea( 100.f, 300.f );
   AlignData data =
index 0c3d9df..7b29200 100755 (executable)
@@ -1150,7 +1150,8 @@ struct Engine::Impl
                                      bool matchSystemLanguageDirection )
   {
     line.alignmentOffset = 0.f;
-    bool isRTL = RTL == line.direction;
+    bool isLineRTL = RTL == line.direction;
+    bool isRTL = isLineRTL;
     float lineLength = line.width;
     HorizontalAlignment::Type alignment = horizontalAlignment;
 
@@ -1191,7 +1192,7 @@ struct Engine::Impl
       {
         line.alignmentOffset = 0.f;
 
-        if( isRTL )
+        if( isLineRTL )
         {
           // 'Remove' the white spaces at the end of the line (which are at the beginning in visual order)
           line.alignmentOffset -= line.extraLength;
@@ -1202,7 +1203,7 @@ struct Engine::Impl
       {
         line.alignmentOffset = 0.5f * ( boxWidth - lineLength );
 
-        if( isRTL )
+        if( isLineRTL )
         {
           line.alignmentOffset -= line.extraLength;
         }
@@ -1212,7 +1213,7 @@ struct Engine::Impl
       }
       case HorizontalAlignment::END:
       {
-        if( isRTL )
+        if( isLineRTL )
         {
           lineLength += line.extraLength;
         }