DALI_TEST_CHECK( NULL != glyphs );
DALI_TEST_CHECK( NULL != layouts );
+ // When the ellipsis is enabled, at least a glyph has to be rendered.
+ // Even if the given width is too narrow for rendering an ellipsis glyph.
+ controller->SetText( "…" );
+ Vector3 sizeEllipsis = controller->GetNaturalSize();
+ controller->SetText( "A" );
+ Vector3 sizeA = controller->GetNaturalSize();
+ float testWidth = sizeA.width < sizeEllipsis.width ? sizeA.width : sizeEllipsis.width - 1.0;
+
+ controller->SetText( "AB" );
+ Vector3 sizeAB = controller->GetNaturalSize();
+
+ controller->Relayout( Size(testWidth, sizeAB.height) );
+
+ // Elide the glyphs.
+ model->ElideGlyphs();
+ DALI_TEST_EQUALS( 1u, model->GetNumberOfGlyphs(), TEST_LOCATION );
+ DALI_TEST_EQUALS( 1u, model->GetNumberOfLines(), TEST_LOCATION );
+
tet_result(TET_PASS);
END_TEST;
}
Size textSize00( 100.f, 100.f );
Size textSize01( 80.f, 100.f );
- float positions01[] = { 0.f, 8.f, 17.f, 27.f, 35.f, 43.f, 47.f, 58.f, 64.0f };
+ float positions01[] = { 0.f, 8.f, 16.f, 26.f, 34.f, 43.f, 47.f, 58.f, 64.0f };
Size textSize02( 80.f, 100.f );
- float positions02[] = { 69.f, 63.f, 58.f, 49.f, 45.f, 41.f, 32.f, 23.f, 8.f };
+ float positions02[] = { 69.f, 63.f, 58.f, 50.f, 45.f, 41.f, 32.f, 23.f, 9.f };
Size textSize03( 80.f, 100.f );
- float positions03[] = { 55.f, 48.f, 44.f, 42.f, 36.f, 29.f, 26.f, 20.f, 13.f, 8.f, 4.f, 6.f };
+ float positions03[] = { 54.f, 47.f, 44.f, 41.f, 36.f, 29.f, 25.f, 20.f, 13.f, 8.f, 4.f, 6.f };
Size textSize04( 80.f, 10.f );
float positions04[] = { 2.f };