X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Flayouts%2Flayout-engine.cpp;h=f4ec1623be809169d3c35f375196d4e62a59535d;hp=d73ee6aa48ed7cb40ce71099f9a1a5cd3a25a674;hb=5a1a51dcf77aa355d5c4888ca2943e0df5415ce5;hpb=271110063e8b896a45d7c9116cf4ad53585933bd diff --git a/dali-toolkit/internal/text/layouts/layout-engine.cpp b/dali-toolkit/internal/text/layouts/layout-engine.cpp index d73ee6a..f4ec162 100755 --- a/dali-toolkit/internal/text/layouts/layout-engine.cpp +++ b/dali-toolkit/internal/text/layouts/layout-engine.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -376,7 +376,7 @@ struct Engine::Impl } else { - lineLayout.length = length; + lineLayout.length = std::max( length, lineLayout.length ); } } } @@ -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; @@ -721,7 +721,7 @@ struct Engine::Impl // Convert the character in the visual order into the glyph in the visual order. const GlyphIndex glyphIndex = *( charactersToGlyphsBuffer + characterVisualIndex ) + index; - DALI_ASSERT_DEBUG( 0u <= glyphIndex && glyphIndex < layoutParameters.textModel->mVisualModel->mGlyphs.Count() ); + DALI_ASSERT_DEBUG( glyphIndex < layoutParameters.textModel->mVisualModel->mGlyphs.Count() ); const GlyphInfo& glyph = *( glyphsBuffer + glyphIndex ); Vector2& position = *( glyphPositionsBuffer + glyphIndex - layoutParameters.startGlyphIndex );