From: Joogab Yun Date: Tue, 31 Mar 2020 01:30:13 +0000 (+0900) Subject: fixed align problems when whitespaces are included X-Git-Tag: submit/tizen/20200407.014802~2^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bc44b15b552235efde7e95bdd5cd2a6c26d7d1d2;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git fixed align problems when whitespaces are included 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 --- diff --git a/dali-toolkit/internal/text/layouts/layout-engine.cpp b/dali-toolkit/internal/text/layouts/layout-engine.cpp index f4ec1623be..e91ebae139 100755 --- a/dali-toolkit/internal/text/layouts/layout-engine.cpp +++ b/dali-toolkit/internal/text/layouts/layout-engine.cpp @@ -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 );