fixed align problems when whitespaces are included 08/229708/1
authorJoogab Yun <joogab.yun@samsung.com>
Tue, 31 Mar 2020 01:30:13 +0000 (10:30 +0900)
committerJoogab Yun <joogab.yun@samsung.com>
Fri, 3 Apr 2020 03:24:33 +0000 (12:24 +0900)
    TextLabel ellipsisTest = TextLabel::New( "abcde abced                                ");
    ellipsisTest.SetAnchorPoint( AnchorPoint::TOP_LEFT );
    ellipsisTest.SetProperty(TextLabel::Property::POINT_SIZE, 34.f);
    ellipsisTest.SetPosition(100.f, 600.f);
    ellipsisTest.SetSize( 344.f, 100.f);
    ellipsisTest.SetProperty(TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER");
    stage.Add( ellipsisTest );

Change-Id: I1641df673a9407e085da8645737f292d73fc8f0f

dali-toolkit/internal/text/layouts/layout-engine.cpp

index f4ec162..e91ebae 100755 (executable)
@@ -923,24 +923,9 @@ struct Engine::Impl
     lineRun.characterRun.numberOfCharacters = layout.numberOfCharacters;
     lineRun.lineSpacing = mDefaultLineSpacing;
 
-    if( isLastLine && !layoutParameters.isLastNewParagraph )
-    {
-      lineRun.width = layout.length;
-      if( LTR == layout.direction )
-      {
-        lineRun.width += layout.whiteSpaceLengthEndOfLine;
-        lineRun.extraLength = 0.f;
-      }
-      else
-      {
-        lineRun.extraLength = layout.whiteSpaceLengthEndOfLine;
-      }
-    }
-    else
-    {
-      lineRun.width = layout.length;
-      lineRun.extraLength = std::ceil( layout.whiteSpaceLengthEndOfLine );
-    }
+    lineRun.width = layout.length;
+    lineRun.extraLength = std::ceil( layout.whiteSpaceLengthEndOfLine );
+
 
     // Rounds upward to avoid a non integer size.
     lineRun.width = std::ceil( lineRun.width );