From: Joogab Yun Date: Mon, 24 Feb 2020 09:16:37 +0000 (+0900) Subject: Fixes a layout bug with the COMBINING GRAVE ACCENT ' ̀' X-Git-Tag: accepted/tizen/5.5/unified/20200303.170632~2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=1effec1a44f2e8c2a777952105267d2c84e72aab Fixes a layout bug with the COMBINING GRAVE ACCENT ' ̀' * The layout engine failed to calculate correctly the length of the line if that character is used in the last position. if HORIZONTAL_ALIGNMENT is END, this is a problem. example) Property::Map backgroundMap; backgroundMap["color"] = Color::RED; backgroundMap["enable"] = true; TextLabel testLabel = TextLabel::New( "Àwọn àgbétẹ́lẹ̀"); testLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT ); testLabel.SetProperty(TextLabel::Property::POINT_SIZE, 34.f); testLabel.SetPosition(100.f, 100.f); testLabel.SetSize( 544.f, 100.f); testLabel.SetProperty(TextLabel::Property::HORIZONTAL_ALIGNMENT, "END"); testLabel.SetProperty(Toolkit::DevelTextLabel::Property::BACKGROUND, backgroundMap); stage.Add( testLabel ); Change-Id: Ic66fd96cc010eada7187502b9b65e2b408eff2cd --- diff --git a/dali-toolkit/internal/text/layouts/layout-engine.cpp b/dali-toolkit/internal/text/layouts/layout-engine.cpp index d73ee6a..3a15375 100755 --- a/dali-toolkit/internal/text/layouts/layout-engine.cpp +++ b/dali-toolkit/internal/text/layouts/layout-engine.cpp @@ -551,7 +551,7 @@ struct Engine::Impl tmpLineLayout.penX += tmpLineLayout.previousAdvance + tmpLineLayout.whiteSpaceLengthEndOfLine; tmpLineLayout.previousAdvance = ( glyphMetrics.advance + parameters.interGlyphExtraAdvance ); - tmpLineLayout.length = tmpLineLayout.penX + glyphMetrics.xBearing + glyphMetrics.width; + tmpLineLayout.length = std::max( tmpLineLayout.length, tmpLineLayout.penX + glyphMetrics.xBearing + glyphMetrics.width ); // Clear the white space length at the end of the line. tmpLineLayout.whiteSpaceLengthEndOfLine = 0.f;