Checking for cache usage is wrong.
For example,
when you create two TextLabels with PointSize 25, 50, ellipsis is created in one size.
ellipsis also changes according to the font size.
TextLabel ellipsisLabel = TextLabel::New( "Hello World" );
ellipsisLabel.SetSize( 170.f, 120.f );
ellipsisLabel.SetProperty( TextLabel::Property::POINT_SIZE, 25.f );
ellipsisLabel.SetProperty( TextLabel::Property::ELLIPSIS, true );
ellipsisLabel.SetPosition( 100.f, 150.f );
ellipsisLabel.SetParentOrigin( ParentOrigin::TOP_LEFT );
ellipsisLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT );
stage.Add( ellipsisLabel );
TextLabel ellipsisLabel2 = TextLabel::New( "Hello World" );
ellipsisLabel2.SetSize( 170.f, 120.f );
ellipsisLabel2.SetProperty( TextLabel::Property::POINT_SIZE, 50.f );
ellipsisLabel2.SetProperty( TextLabel::Property::ELLIPSIS, true );
ellipsisLabel2.SetPosition( 100.f, 250.f );
ellipsisLabel2.SetParentOrigin( ParentOrigin::TOP_LEFT );
ellipsisLabel2.SetAnchorPoint( AnchorPoint::TOP_LEFT );
stage.Add( ellipsisLabel2 );
Change-Id: I66426a59b5cfdd68d09b9c6f862606a38d1a1986
// First look into the cache if there is an ellipsis glyph for the requested point size.
for( const auto& item : mEllipsisCache )
{
- if( item.requestedPointSize != requestedPointSize )
+ if( item.requestedPointSize == requestedPointSize )
{
// Use the glyph in the cache.