X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-view.cpp;h=73334282c4d677c5e41ef06ff944043e01727cdd;hb=97d688bcdfb692dd2ff535c1965077dd747cfcf6;hp=be6ac8f9733cd7bc420544da1f1064b59dca2d02;hpb=32b0b5f6c65842c8bd1140b1eeb9691fdca0c866;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/text-view.cpp b/dali-toolkit/internal/text/text-view.cpp index be6ac8f..7333428 100644 --- a/dali-toolkit/internal/text/text-view.cpp +++ b/dali-toolkit/internal/text/text-view.cpp @@ -190,6 +190,24 @@ Length View::GetGlyphs( GlyphInfo* glyphs, if( lastLine.ellipsis ) { + if( ( 1u == numberOfLines ) && + ( lastLine.ascender - lastLine.descender > mImpl->mVisualModel->mControlSize.height ) ) + { + // Get the first glyph which is going to be replaced and the ellipsis glyph. + GlyphInfo& glyphInfo = *glyphs; + const GlyphInfo& ellipsisGlyph = mImpl->mFontClient.GetEllipsisGlyph( mImpl->mFontClient.GetPointSize( glyphInfo.fontId ) ); + + // Change the 'x' and 'y' position of the ellipsis glyph. + Vector2& position = *glyphPositions; + position.x = ellipsisGlyph.xBearing; + position.y = mImpl->mVisualModel->mControlSize.height - ellipsisGlyph.yBearing; + + // Replace the glyph by the ellipsis glyph. + glyphInfo = ellipsisGlyph; + + return 1u; + } + // firstPenX, penY and firstPenSet are used to position the ellipsis glyph if needed. float firstPenX = 0.f; // Used if rtl text is elided. float penY = 0.f;