ex) An ellipsis may be displayed incorrectly when there are two or more
new-line characters.
TextLabel labe34 = TextLabel::New( "yesterday all my troubles
seemed so\n\n\n\n far away now it looks" );
labe34.SetSize( 450, 100 );
labe34.SetParentOrigin(ParentOrigin::TOP_LEFT);
labe34.SetAnchorPoint(AnchorPoint::TOP_LEFT);
labe34.SetPosition( 100.f, 500.f);
labe34.SetProperty(TextLabel::Property::POINT_SIZE, 17.6f);
labe34.SetProperty( TextLabel::Property::MULTI_LINE, true );
labe34.SetProperty(TextLabel::Property::ELLIPSIS, true);
stage.Add( labe34 );
Change-Id: Ib35468303dd985486de96f66cb24d244e16f5a69
unsigned int numberOfLines;
unsigned int numberOfGlyphs;
float* positions;
unsigned int numberOfLines;
unsigned int numberOfGlyphs;
float* positions;
- unsigned int ignoreOfGlyphs;
};
bool ElideTest( const ElideData& data )
};
bool ElideTest( const ElideData& data )
if( numberOfLines != 0u )
{
const LineRun& lastLine = *( model->GetLines() + numberOfLines - 1u );
if( numberOfLines != 0u )
{
const LineRun& lastLine = *( model->GetLines() + numberOfLines - 1u );
- const Length numberOfLastLineGlyphs = data.numberOfGlyphs - lastLine.glyphRun.glyphIndex + data.ignoreOfGlyphs;
+ const Length numberOfLastLineGlyphs = data.numberOfGlyphs - lastLine.glyphRun.glyphIndex;
std::cout << " last line alignment offset : " << lastLine.alignmentOffset << std::endl;
std::cout << " last line alignment offset : " << lastLine.alignmentOffset << std::endl;
Size textSize04( 80.f, 10.f );
float positions04[] = { 2.f };
Size textSize04( 80.f, 10.f );
float positions04[] = { 2.f };
- Size textSize05( 180.f, 100.f );
- float positions05[] = { 0.f, 0.f };
-
struct ElideData data[] =
{
{
struct ElideData data[] =
{
{
},
{
"Small control size, no line fits.",
},
{
"Small control size, no line fits.",
- positions04,
- 0u
- },
- {
- "Include newline character",
- "<font family='TizenSans'>yesterday\n all\n my troubles\n seemed so far\n\n away now it looks</font>",
- textSize05,
- 5u,
- 40,
- positions05,
- 5u
- },
- const unsigned int numberOfTests = 6u;
+ const unsigned int numberOfTests = 5u;
for( unsigned int index = 0u; index < numberOfTests; ++index )
{
for( unsigned int index = 0u; index < numberOfTests; ++index )
{
glyphInfo = ellipsisGlyph;
// Change the 'x' and 'y' position of the ellipsis glyph.
glyphInfo = ellipsisGlyph;
// Change the 'x' and 'y' position of the ellipsis glyph.
-
- if( position.x > firstPenX )
- {
- position.x = firstPenX + removedGlypsWidth - ellipsisGlyphWidth;
- }
-
position.x += ellipsisGlyph.xBearing;
position.y = penY - ellipsisGlyph.yBearing;
position.x += ellipsisGlyph.xBearing;
position.y = penY - ellipsisGlyph.yBearing;
- // If the index decreases to the previous line, firstPenX must be recalculated.
- if( numberOfLaidOutGlyphs - index == lastLine.glyphRun.numberOfGlyphs)
- {
- firstPenSet = false;
- }