From bb0af65c5caa5658bae6068f9d81d27b38f67a50 Mon Sep 17 00:00:00 2001 From: Seoyeon Kim Date: Tue, 8 Oct 2019 13:22:57 +0900 Subject: [PATCH] Revert "[Tizen] Hebrew language text is cutted in TextLabel." This reverts commit 5c1b715c4f0dce61a82ee5280137483d36c7e9c5. --- dali-toolkit/internal/text/layouts/layout-engine.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dali-toolkit/internal/text/layouts/layout-engine.cpp b/dali-toolkit/internal/text/layouts/layout-engine.cpp index 6a93d6b..9d1b93d 100755 --- a/dali-toolkit/internal/text/layouts/layout-engine.cpp +++ b/dali-toolkit/internal/text/layouts/layout-engine.cpp @@ -224,7 +224,7 @@ struct Engine::Impl // The initial start point is zero. However it needs a correction according the 'x' bearing of the first glyph. // i.e. if the bearing of the first glyph is negative it may exceed the boundaries of the text area. // It needs to add as well space for the cursor if the text is in edit mode and extra space in case the text is outlined. - tmpLineLayout.penX = ( 0.f > glyphMetrics.xBearing ) ? -glyphMetrics.xBearing : 0.f + mCursorWidth + parameters.outlineWidth; + tmpLineLayout.penX = -glyphMetrics.xBearing + mCursorWidth + parameters.outlineWidth; // Initialize the advance of the previous glyph. tmpLineLayout.previousAdvance = 0.f; @@ -298,9 +298,9 @@ struct Engine::Impl } else { - tmpLineLayout.previousAdvance = ( glyphMetrics.advance + parameters.interGlyphExtraAdvance ); tmpLineLayout.penX += tmpLineLayout.previousAdvance + tmpLineLayout.wsLengthEndOfLine; - tmpLineLayout.length = tmpLineLayout.penX; + tmpLineLayout.previousAdvance = ( glyphMetrics.advance + parameters.interGlyphExtraAdvance ); + tmpLineLayout.length = tmpLineLayout.penX + glyphMetrics.xBearing + glyphMetrics.width; // Clear the white space length at the end of the line. tmpLineLayout.wsLengthEndOfLine = 0.f; @@ -391,7 +391,7 @@ struct Engine::Impl // so the penX position needs to be moved to the right. const GlyphInfo& glyph = *glyphsBuffer; - float penX = ( 0.f > glyph.xBearing ) ? -glyph.xBearing : 0.f + mCursorWidth + outlineWidth; + float penX = -glyph.xBearing + mCursorWidth + outlineWidth; for( GlyphIndex i = 0u; i < numberOfGlyphs; ++i ) { @@ -985,7 +985,7 @@ struct Engine::Impl const CharacterIndex characterVisualIndex = bidiLine.characterRun.characterIndex + *bidiLine.visualToLogicalMap; const GlyphInfo& glyph = *( layoutParameters.glyphsBuffer + *( layoutParameters.charactersToGlyphsBuffer + characterVisualIndex ) ); - float penX = ( 0.f > glyph.xBearing ) ? -glyph.xBearing : 0.f + layoutParameters.outlineWidth + mCursorWidth; + float penX = -glyph.xBearing + layoutParameters.outlineWidth + mCursorWidth; Vector2* glyphPositionsBuffer = glyphPositions.Begin(); -- 2.7.4