When setting negative line spacing, ellipsis applied even there is space for more lines.
Change-Id: Ife870f11b7b081fcdc0447a5fc96d0fce1a1e95b
END_TEST;
}
+int UtcDaliTextEditorNegativeLineSpacingWithEllipsis(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliTextEditorNegativeLineSpacingWithEllipsis");
+
+ TextEditor editor = TextEditor::New();
+
+ float lineSpacing = -20.f;
+
+ editor.SetProperty(Actor::Property::SIZE, Vector2(480.0f, 100.f));
+ editor.SetProperty(TextEditor::Property::POINT_SIZE, 11.0f);
+ editor.SetProperty(DevelTextEditor::Property::LINE_SPACING, lineSpacing);
+ editor.SetProperty(TextEditor::Property::TEXT, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.");
+ editor.SetProperty(DevelTextEditor::Property::ELLIPSIS, true);
+
+ application.GetScene().Add(editor);
+ application.SendNotification();
+ application.Render();
+
+ Vector<Vector2> sizeList = DevelTextEditor::GetTextSize(editor, 0, 123);
+
+ int lineCount = sizeList.Size();
+ DALI_TEST_EQUALS(4, lineCount, TEST_LOCATION);
+
+ application.SendNotification();
+ application.Render();
+
+ END_TEST;
+}
+
int UtcDaliToolkitTexteditorParagraphTag(void)
{
ToolkitTestApplication application;
END_TEST;
}
+int UtcDaliTextLabelNegativeLineSpacingWithEllipsis(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliTextLabelNegativeLineSpacingWithEllipsis");
+
+ TextLabel label = TextLabel::New();
+
+ float lineSpacing = -20.f;
+
+ label.SetProperty(Actor::Property::SIZE, Vector2(480.0f, 100.f));
+ label.SetProperty(TextLabel::Property::POINT_SIZE, 11.0f);
+ label.SetProperty(DevelTextLabel::Property::LINE_SPACING, lineSpacing);
+ label.SetProperty(TextLabel::Property::MULTI_LINE, true);
+ label.SetProperty(TextLabel::Property::TEXT, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.");
+ label.SetProperty(TextLabel::Property::ELLIPSIS, true);
+
+ application.GetScene().Add(label);
+ application.SendNotification();
+ application.Render();
+
+ Vector<Vector2> sizeList = DevelTextLabel::GetTextSize(label, 0, 123);
+
+ int lineCount = sizeList.Size();
+ DALI_TEST_EQUALS(4, lineCount, TEST_LOCATION);
+
+ application.SendNotification();
+ application.Render();
+
+ END_TEST;
+}
+
int UtcDaliToolkitTextlabelParagraphTag(void)
{
ToolkitTestApplication application;
{
layoutSize.height += GetLineHeight(*lineRun, true);
}
+ else
+ {
+ //when we apply ellipsis, the last line should not take negative linespacing into account for layoutSize.height calculation
+ //usually we don't includ it in normal cases using GetLineHeight()
+ if(lineRun->lineSpacing < 0)
+ {
+ layoutSize.height -= lineRun->lineSpacing;
+ }
+ }
const Vector<BidirectionalLineInfoRun>& bidirectionalLinesInfo = layoutParameters.textModel->mLogicalModel->mBidirectionalLineInfo;