Resolve incorrect position for Ellipsis when mixed LTR & RTL languages and set layout... 95/275895/6
authorssabah <s.sabah@samsung.com>
Sun, 5 Jun 2022 12:08:04 +0000 (15:08 +0300)
committerssabah <s.sabah@samsung.com>
Wed, 8 Jun 2022 12:56:25 +0000 (15:56 +0300)
commit528ee21711fc507b20ddb031cf6b1d71f1f44e75
tree0b6ac245b53e0faf43b76d6e7fb21479c1754eba
parent8e8d63d501dc8c26f84932dfad3a9e3a9083cfb1
Resolve incorrect position for Ellipsis when mixed LTR & RTL languages and set layout direction RTL

Here's sample code for issues:
    //Case 1:
    TextLabel textLabel = TextLabel::New("Projector استكشاف");
    textLabel.SetProperty(Dali::Toolkit::DevelTextLabel::Property::ELLIPSIS, true);
    textLabel.SetProperty(Dali::Toolkit::DevelTextLabel::Property::ELLIPSIS_POSITION, Dali::Toolkit::DevelText::EllipsisPosition::END);
    textLabel.SetProperty(Dali::Actor::Property::LAYOUT_DIRECTION, LayoutDirection::RIGHT_TO_LEFT);
    textLabel.SetProperty(Actor::Property::SIZE, Vector2(145.0f, 60.0f)); // minimize width until the ellipsis comes between two languages

    //Case 2:
    TextLabel textLabel = TextLabel::New("استكشاف Projector");
    textLabel.SetProperty(Dali::Toolkit::DevelTextLabel::Property::ELLIPSIS, true);
    textLabel.SetProperty(Dali::Toolkit::DevelTextLabel::Property::ELLIPSIS_POSITION, Dali::Toolkit::DevelText::EllipsisPosition::START);
    textLabel.SetProperty(Dali::Actor::Property::LAYOUT_DIRECTION, LayoutDirection::RIGHT_TO_LEFT);
    textLabel.SetProperty(Actor::Property::SIZE, Vector2(145.0f, 60.0f)); // minimize width until the ellipsis comes between two languages

Change-Id: Ia645d143083074383f4db3b8b2407810b69e4862
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Ellipsis.cpp
dali-toolkit/internal/text/rendering/view-model.cpp
dali-toolkit/internal/text/text-view.cpp