X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Flayouts%2Flayout-engine.cpp;h=a3ceee2254f783cce8f65ffcb58b9a3523ee1258;hb=23b11d5e9e206a703616aeef9bea3f75647a54db;hp=8d9f8f521ab92a4a8c1b426ddced2896109fefab;hpb=479693b4fd773eb8888ae401d02b49188293e231;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/layouts/layout-engine.cpp b/dali-toolkit/internal/text/layouts/layout-engine.cpp index 8d9f8f5..a3ceee2 100644 --- a/dali-toolkit/internal/text/layouts/layout-engine.cpp +++ b/dali-toolkit/internal/text/layouts/layout-engine.cpp @@ -596,7 +596,10 @@ struct LayoutEngine::Impl lineRun->ellipsis = true; layoutSize.width = layoutParameters.boundingBox.width; - layoutSize.height += ( lineRun->ascender + -lineRun->descender ); + if( layoutSize.height < Math::MACHINE_EPSILON_1000 ) + { + layoutSize.height += ( lineRun->ascender + -lineRun->descender ); + } SetGlyphPositions( layoutParameters.glyphsBuffer + lineRun->glyphRun.glyphIndex, ellipsisLayout.numberOfGlyphs, @@ -795,6 +798,10 @@ struct LayoutEngine::Impl } } + // Calculates the layout size. + UpdateLayoutSize( lines, + layoutSize ); + // Nothing else do if there are no glyphs to layout. return false; } @@ -1069,10 +1076,12 @@ struct LayoutEngine::Impl void Align( const Size& size, CharacterIndex startIndex, Length numberOfCharacters, - Vector& lines ) + Vector& lines, + float& alignmentOffset ) { const CharacterIndex lastCharacterPlusOne = startIndex + numberOfCharacters; + alignmentOffset = MAX_FLOAT; // Traverse all lines and align the glyphs. for( Vector::Iterator it = lines.Begin(), endIt = lines.End(); it != endIt; @@ -1096,6 +1105,9 @@ struct LayoutEngine::Impl // the box width, line length, and the paragraph's direction. CalculateHorizontalAlignment( size.width, line ); + + // Updates the alignment offset. + alignmentOffset = std::min( alignmentOffset, line.alignmentOffset ); } } @@ -1288,12 +1300,14 @@ void LayoutEngine::ReLayoutRightToLeftLines( const LayoutParameters& layoutParam void LayoutEngine::Align( const Size& size, CharacterIndex startIndex, Length numberOfCharacters, - Vector& lines ) + Vector& lines, + float& alignmentOffset ) { mImpl->Align( size, startIndex, numberOfCharacters, - lines ); + lines, + alignmentOffset ); } void LayoutEngine::SetDefaultLineSpacing( float lineSpacing )