From 58229c6d77a399f3f571c841dd0c39d970a8f030 Mon Sep 17 00:00:00 2001 From: Joogab Yun Date: Mon, 24 Feb 2020 18:16:37 +0900 Subject: [PATCH] =?utf8?q?Fixes=20a=20layout=20bug=20with=20the=20COMBININ?= =?utf8?q?G=20GRAVE=20ACCENT=20'=20=CC=80'?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * 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 --- dali-toolkit/internal/text/layouts/layout-engine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dali-toolkit/internal/text/layouts/layout-engine.cpp b/dali-toolkit/internal/text/layouts/layout-engine.cpp index 525e031..9dccc05 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; -- 2.7.4