From: Bowon Ryu Date: Thu, 9 Jun 2022 10:28:54 +0000 (+0000) Subject: Merge "Fix text AutoScroll ellipsis issue" into devel/master X-Git-Tag: dali_2.1.26~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=b5fd9045b672b657db6f6647ed57d0380d29a6aa;hp=c427acac5f2616578c05987c99e7b430c9ab0137 Merge "Fix text AutoScroll ellipsis issue" into devel/master --- diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Ellipsis.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Ellipsis.cpp index bab8800..75d8bb4 100755 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Ellipsis.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Ellipsis.cpp @@ -74,7 +74,7 @@ namespace ControllerPtr controller = Controller::New(); // Tests the rendering controller has been created. - TypesetterPtr typesetter = Typesetter::New( controller->GetTextModel() ); + TypesetterPtr typesetter = Typesetter::New(controller->GetTextModel()); DALI_TEST_CHECK(typesetter); // Tests the view model has been created. @@ -91,7 +91,7 @@ namespace controller->SetLineWrapMode( (Text::LineWrap::Mode)(data.lineWrapMode) ); controller->SetEllipsisPosition( data.ellipsisPosition ); - controller->SetText( data.text ); + controller->SetText(data.text); controller->Relayout( data.size ); // Elide the glyphs. @@ -532,780 +532,736 @@ int UtcDaliTextLabelElideTextLocation(void) Size textSize36( 120.0f, 30.0f ); float positions36[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f }; + Size textSize37(145.0f, 30.0f); + float positions37[] = {131.0f, 126.0f, 121.0f, 116.0f, 108.0f, 103.0f, 93.0f, 88.0f, 20.0f, 29.0f, 34.0f, 42.0f, 48.0f, 57.0f, 67.0f}; + + Size textSize38(145.0f, 30.0f); + float positions38[] = {51.0f, 66.0f, 71.0f, 79.0f, 85.0f, 94.0f, 103.0f, 109.0f, 119.0f, 51.0f, 37.0f, 32.0f, 27.0f, 23.0f, 14.0f, 10.0f, 0.0f}; + struct ElideData data[] = - { { - "void text", - "", - false, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::END, - false, - textSize00, - 0u, - 0u, - nullptr - }, + {"void text", + "", + false, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::END, + false, + textSize00, + 0u, + 0u, + nullptr}, + + {"void text", + "", + false, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::START, + false, + textSize00, + 0u, + 0u, + nullptr}, + + {"void text", + "", + false, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::MIDDLE, + false, + textSize00, + 0u, + 0u, + nullptr}, + + //END LTR cases + { + "EllipsisPosition: TextLabel: Basic case SingleLine LTR END", + "A0123456789 B0123456789 C0123456789 D0123456789 ", + false, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::END, + false, + textSize01, + 1u, + 10u, + positions01}, + + {"EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR END", + "A0123456789 B0123456789 C0123456789 D0123456789 ", + true, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::END, + false, + textSize02, + 2u, + 22u, + positions02}, + + {"EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR END", + "Hello Hi Experimen Welcome Hello Hi Experimen Welcome", + true, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::END, + false, + textSize03, + 3u, + 29u, + positions03}, + + {"EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR END", + "Hello Hi Experimen Welcome Hello Hi Experimen Welcome", + true, + DevelText::LineWrap::CHARACTER, + DevelText::EllipsisPosition::END, + false, + textSize04, + 3u, + 40u, + positions04}, + + {"EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR END", + "Hello Hi Experimen Welcome Hello Hi Experimen Welcome", + true, + DevelText::LineWrap::HYPHENATION, + DevelText::EllipsisPosition::END, + false, + textSize05, + 3u, + 32u, + positions05}, + + {"EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR END", + "Hello Hi Experimen Welcome Hello Hi Experimen Welcome", + true, + DevelText::LineWrap::MIXED, + DevelText::EllipsisPosition::END, + false, + textSize06, + 3u, + 28u, + positions06}, + + //START LTR cases + { + "EllipsisPosition: TextLabel: Basic case SingleLine LTR START", + "A0123456789 B0123456789 C0123456789 D0123456789 ", + false, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::START, + false, + textSize07, + 1u, + 11u, + positions07, + + }, + + {"EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR START", + "A0123456789 B0123456789 C0123456789 D0123456789 ", + true, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::START, + false, + textSize08, + 2u, + 23u, + positions08}, + + {"EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR START", + "Hello Hi Experimen Welcome Hello Hi Experimen Welcome", + true, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::START, + false, + textSize09, + 3u, + 33u, + positions09}, + + {"EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR START", + "Hello Hi Experimen Welcome Hello Hi Experimen Welcome", + true, + DevelText::LineWrap::CHARACTER, + DevelText::EllipsisPosition::START, + false, + textSize10, + 3u, + 37u, + positions10}, + + {"EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR START", + "Hello Hi Experimen Welcome Hello Hi Experimen Welcome", + true, + DevelText::LineWrap::HYPHENATION, + DevelText::EllipsisPosition::START, + false, + textSize11, + 3u, + 25u, + positions11}, + + {"EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR START", + "Hello Hi Experimen Welcome Hello Hi Experimen Welcome", + true, + DevelText::LineWrap::MIXED, + DevelText::EllipsisPosition::START, + false, + textSize12, + 3u, + 25u, + positions12}, + + //END RTL cases + { + "EllipsisPosition: TextLabel: SingleLine RTL END", + "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", + false, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::END, + false, + textSize13, + 1u, + 14u, + positions13}, + + {"EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL END", + "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", + true, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::END, + false, + textSize14, + 3u, + 42u, + positions14}, + + {"EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL END", + "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", + true, + DevelText::LineWrap::CHARACTER, + DevelText::EllipsisPosition::END, + false, + textSize15, + 3u, + 44u, + positions15}, + + {"EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL END", + "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", + true, + DevelText::LineWrap::HYPHENATION, + DevelText::EllipsisPosition::END, + false, + textSize16, + 3u, + 39u, + positions16}, + + {"EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL END", + "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", + true, + DevelText::LineWrap::MIXED, + DevelText::EllipsisPosition::END, + false, + textSize17, + 3u, + 39u, + positions17}, + + //START RTL cases + { + "EllipsisPosition: TextLabel: SingleLine RTL START", + "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", + false, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::START, + false, + textSize18, + 1u, + 13u, + positions18}, + + {"EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL START", + "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", + true, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::START, + false, + textSize19, + 3u, + 33u, + positions19}, + + {"EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL START", + "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", + true, + DevelText::LineWrap::CHARACTER, + DevelText::EllipsisPosition::START, + false, + textSize20, + 3u, + 30u, + positions20}, + + {"EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL START", + "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", + true, + DevelText::LineWrap::HYPHENATION, + DevelText::EllipsisPosition::START, + false, + textSize21, + 3u, + 33u, + positions21}, + + {"EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL START", + "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", + true, + DevelText::LineWrap::MIXED, + DevelText::EllipsisPosition::START, + false, + textSize22, + 3u, + 33u, + positions22}, + + //MIDDLE LTR cases + { + "EllipsisPosition: TextLabel: Basic case SingleLine LTR MIDDLE", + "ABCDEFGHIJKLMNPQRSTUVWXYZ abcdefghijklmnpqrstuvwxyz", + false, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::MIDDLE, + false, + textSize23, + 1u, + 10u, + positions23}, + + {"EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR MIDDLE", + "A0123456789 B0123456789 C0123456789 D0123456789 ", + true, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::MIDDLE, + false, + textSize24, + 2u, + 22u, + positions24}, + + {"EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR MIDDLE", + "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye", + true, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::MIDDLE, + false, + textSize25, + 3u, + 24u, + positions25}, + + {"EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR MIDDLE", + "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye", + true, + DevelText::LineWrap::CHARACTER, + DevelText::EllipsisPosition::MIDDLE, + false, + textSize26, + 3u, + 36u, + positions26}, + + {"EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR MIDDLE", + "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye", + true, + DevelText::LineWrap::HYPHENATION, + DevelText::EllipsisPosition::MIDDLE, + false, + textSize27, + 3u, + 27u, + positions27}, + + {"EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR MIDDLE", + "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye", + true, + DevelText::LineWrap::MIXED, + DevelText::EllipsisPosition::MIDDLE, + false, + textSize28, + 3u, + 24u, + positions28}, + + //MIDDLE RTL cases + { + "EllipsisPosition: TextLabel: SingleLine RTL MIDDLE", + "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", + false, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::MIDDLE, + false, + textSize29, + 1u, + 13u, + positions29}, + + {"EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL MIDDLE", + "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", + true, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::MIDDLE, + false, + textSize30, + 3u, + 31u, + positions30}, + + {"EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL MIDDLE", + "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", + true, + DevelText::LineWrap::CHARACTER, + DevelText::EllipsisPosition::MIDDLE, + false, + textSize31, + 3u, + 29u, + positions31}, + + {"EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL MIDDLE", + "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", + true, + DevelText::LineWrap::HYPHENATION, + DevelText::EllipsisPosition::MIDDLE, + false, + textSize32, + 3u, + 31u, + positions32}, + + {"EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL MIDDLE", + "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", + true, + DevelText::LineWrap::MIXED, + DevelText::EllipsisPosition::MIDDLE, + false, + textSize33, + 3u, + 31u, + positions33}, + + {"EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR END", + "Hello Hi Experimen Welcome Hello Hi Experimen Welcome", + true, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::END, + false, + textSize34, + 1u, + 13u, + positions34}, + + {"EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR START", + "Hello Hi Experimen Welcome Hello Hi Experimen Welcome", + true, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::START, + false, + textSize35, + 1u, + 11u, + positions35}, + + {"EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR MIDDLE", + "Hello Hi Experimen Welcome Hello Hi Experimen Welcome", + true, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::MIDDLE, + false, + textSize36, + 1u, + 12u, + positions36}, + + {"EllipsisPosition: TextLabel: Mixed Directions Languages END", + "سیٹنگیں Projector سیٹنگیں", + false, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::END, + false, + textSize37, + 1u, + 16u, + positions37}, + + {"EllipsisPosition: TextLabel: Mixed Directions Languages START", + "سیٹنگیں Projector سیٹنگیں", + false, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::START, + false, + textSize38, + 1u, + 17u, + positions38}, + + }; + const unsigned int numberOfTests = 41u; + for( unsigned int index = 0u; index < numberOfTests; ++index ) + { + ToolkitTestApplication application; + if( !ElideTestViewModel( data[index] ) ) { - "void text", - "", - false, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::START, - false, - textSize00, - 0u, - 0u, - nullptr - }, + tet_result(TET_FAIL); + } + } - { - "void text", - "", - false, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::MIDDLE, - false, - textSize00, - 0u, - 0u, - nullptr - }, + tet_result(TET_PASS); + END_TEST; +} - //END LTR cases - { - "EllipsisPosition: TextLabel: Basic case SingleLine LTR END", - "A0123456789 B0123456789 C0123456789 D0123456789 ", - false, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::END, - false, - textSize01, - 1u, - 10u, - positions01 - }, - { - "EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR END", - "A0123456789 B0123456789 C0123456789 D0123456789 ", - true, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::END, - false, - textSize02, - 2u, - 22u, - positions02 - }, +int UtcDaliTextFieldlElideTextLocation(void) +{ + tet_infoline(" UtcDaliTextFieldlElideTextLocation "); - { - "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR END", - "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" , - true, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::END, - false, - textSize03, - 3u, - 29u, - positions03 - }, + Size textSize00( 100.f, 100.f ); - { - "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR END", - "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" , - true, - DevelText::LineWrap::CHARACTER, - DevelText::EllipsisPosition::END, - false, - textSize04, - 3u, - 40u, - positions04 - }, + Size textSize01( 120.0f, 50.0f ); + float positions01[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 91.0f }; - { - "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR END", - "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" , - true, - DevelText::LineWrap::HYPHENATION, - DevelText::EllipsisPosition::END, - false, - textSize05, - 3u, - 32u, - positions05 - }, + Size textSize02( 120.0f, 50.0f ); + float positions02[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 84.0f, 93.0f }; - { - "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR END", - "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" , - true, - DevelText::LineWrap::MIXED, - DevelText::EllipsisPosition::END, - false, - textSize06, - 3u, - 28u, - positions06 - }, + Size textSize03( 120.0f, 50.0f ); + float positions03[] = { 117.0f, 111.0f, 97.0f, 88.0f, 80.0f, 74.0f, 64.0f, 59.0f, 54.0f, 45.0f, 37.0f, 31.0f, 22.0f, 7.0f }; - //START LTR cases - { - "EllipsisPosition: TextLabel: Basic case SingleLine LTR START", - "A0123456789 B0123456789 C0123456789 D0123456789 ", - false, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::START, - false, - textSize07, - 1u, - 11u, - positions07 - }, + Size textSize04( 120.0f, 50.0f ); + float positions04[] = { 5.0f, 21.0f, 31.0f, 41.0f, 50.0f, 61.0f, 71.0f, 80.0f, 90.0f, 100.0f, 109.0f }; - { - "EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR START", - "A0123456789 B0123456789 C0123456789 D0123456789 ", - true, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::START, - false, - textSize08, - 2u, - 23u, - positions08 - }, + Size textSize05( 120.0f, 50.0f ); + float positions05[] = { 8.0f, 24.0f, 35.0f, 44.0f, 49.0f, 63.0f, 74.0f, 77.0f, 85.0f, 96.0f, 110.0f }; - { - "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR START", - "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" , - true, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::START, - false, - textSize09, - 3u, - 33u, - positions09 - }, + Size textSize06( 120.0f, 50.0f ); + float positions06[] = { 90.0f, 79.0f, 70.0f, 68.0f, 62.0f, 56.0f, 51.0f, 42.0f, 29.0f, 26.0f, 15.0f, 7.0f, 0.0f }; - { - "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR START", - "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" , - true, - DevelText::LineWrap::CHARACTER, - DevelText::EllipsisPosition::START, - false, - textSize10, - 3u, - 37u, - positions10 - }, + Size textSize07( 120.0f, 50.0f ); + float positions07[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 53.0f }; - { - "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR START", - "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" , - true, - DevelText::LineWrap::HYPHENATION, - DevelText::EllipsisPosition::START, - false, - textSize11, - 3u, - 25u, - positions11 - }, + Size textSize08( 120.0f, 50.0f ); + float positions08[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f }; - { - "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR START", - "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" , - true, - DevelText::LineWrap::MIXED, - DevelText::EllipsisPosition::START, - false, - textSize12, - 3u, - 25u, - positions12 - }, + Size textSize09( 120.0f, 50.0f ); + float positions09[] = { 116.0f, 109.0f, 96.0f, 87.0f, 79.0f, 73.0f, 63.0f }; - //END RTL cases - { - "EllipsisPosition: TextLabel: SingleLine RTL END", - "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", - false, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::END, - false, - textSize13, - 1u, - 14u, - positions13 - }, + Size textSize10( 120.0f, 50.0f ); + float positions10[] = { 121.0f, 116.0f, 111.0f, 106.0f, 101.0f, 96.0f, 92.0f, 87.0f, 83.0f, 77.0f, 63.0f, 55.0f, 46.0f, 40.0f, 30.0f, 16.0f }; - { - "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL END", - "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", - true, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::END, - false, - textSize14, - 3u, - 42u, - positions14 - }, + Size textSize11( 120.0f, 50.0f ); + float positions11[] = { 93.0f, 77.0f, 74.0f, 63.0f, 56.0f, 49.0f, 44.0f, 39.0f, 34.0f, 29.0f, 24.0f, 19.0f, 14.0f, 9.0f, 5.0f }; - { - "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL END", - "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", - true, - DevelText::LineWrap::CHARACTER, - DevelText::EllipsisPosition::END, - false, - textSize15, - 3u, - 44u, - positions15 - }, + Size textSize12( 120.0f, 50.0f ); + float positions12[] = { 117.0f, 112.0f, 107.0f, 102.0f, 97.0f, 92.0f, 87.0f, 82.0f, 79.0f, 72.0f }; + Size textSize13(145.0f, 30.0f); + float positions13[] = {131.0f, 126.0f, 121.0f, 117.0f, 108.0f, 104.0f, 94.0f, 88.0f, 20.0f, 29.0f, 34.0f, 42.0f, 48.0f, 57.0f, 67.0f}; + + Size textSize14(145.0f, 30.0f); + float positions14[] = {51.0f, 66.0f, 71.0f, 80.0f, 85.0f, 94.0f, 103.0f, 109.0f, 119.0f, 51.0f, 37.0f, 32.0f, 28.0f, 23.0f, 14.0f, 10.0f, 0.0f}; + + struct ElideData data[] = { - "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL END", - "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", - true, - DevelText::LineWrap::HYPHENATION, - DevelText::EllipsisPosition::END, - false, - textSize16, - 3u, - 39u, - positions16 - }, - - { - "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL END", - "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", - true, - DevelText::LineWrap::MIXED, - DevelText::EllipsisPosition::END, - false, - textSize17, - 3u, - 39u, - positions17 - }, - - //START RTL cases - { - "EllipsisPosition: TextLabel: SingleLine RTL START", - "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", - false, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::START, - false, - textSize18, - 1u, - 13u, - positions18 - }, - - { - "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL START", - "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", - true, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::START, - false, - textSize19, - 3u, - 33u, - positions19 - }, - - { - "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL START", - "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", - true, - DevelText::LineWrap::CHARACTER, - DevelText::EllipsisPosition::START, - false, - textSize20, - 3u, - 30u, - positions20 - }, - - { - "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL START", - "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", - true, - DevelText::LineWrap::HYPHENATION, - DevelText::EllipsisPosition::START, - false, - textSize21, - 3u, - 33u, - positions21 - }, - - { - "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL START", - "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", - true, - DevelText::LineWrap::MIXED, - DevelText::EllipsisPosition::START, - false, - textSize22, - 3u, - 33u, - positions22 - }, - - //MIDDLE LTR cases - { - "EllipsisPosition: TextLabel: Basic case SingleLine LTR MIDDLE", - "ABCDEFGHIJKLMNPQRSTUVWXYZ abcdefghijklmnpqrstuvwxyz", - false, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::MIDDLE, - false, - textSize23, - 1u, - 10u, - positions23 - }, - - { - "EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR MIDDLE", - "A0123456789 B0123456789 C0123456789 D0123456789 ", - true, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::MIDDLE, - false, - textSize24, - 2u, - 22u, - positions24 - }, - - { - "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR MIDDLE", - "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" , - true, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::MIDDLE, - false, - textSize25, - 3u, - 24u, - positions25 - }, - - { - "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR MIDDLE", - "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" , - true, - DevelText::LineWrap::CHARACTER, - DevelText::EllipsisPosition::MIDDLE, - false, - textSize26, - 3u, - 36u, - positions26 - }, - - { - "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR MIDDLE", - "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" , - true, - DevelText::LineWrap::HYPHENATION, - DevelText::EllipsisPosition::MIDDLE, - false, - textSize27, - 3u, - 27u, - positions27 - }, - - { - "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR MIDDLE", - "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" , - true, - DevelText::LineWrap::MIXED, - DevelText::EllipsisPosition::MIDDLE, - false, - textSize28, - 3u, - 24u, - positions28 - }, - -//MIDDLE RTL cases - { - "EllipsisPosition: TextLabel: SingleLine RTL MIDDLE", - "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", - false, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::MIDDLE, - false, - textSize29, - 1u, - 13u, - positions29 - }, - - { - "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL MIDDLE", - "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", - true, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::MIDDLE, - false, - textSize30, - 3u, - 31u, - positions30 - }, - - { - "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL MIDDLE", - "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", - true, - DevelText::LineWrap::CHARACTER, - DevelText::EllipsisPosition::MIDDLE, - false, - textSize31, - 3u, - 29u, - positions31 - }, - - { - "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL MIDDLE", - "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", - true, - DevelText::LineWrap::HYPHENATION, - DevelText::EllipsisPosition::MIDDLE, - false, - textSize32, - 3u, - 31u, - positions32 - }, - - { - "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL MIDDLE", - "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", - true, - DevelText::LineWrap::MIXED, - DevelText::EllipsisPosition::MIDDLE, - false, - textSize33, - 3u, - 31u, - positions33 - }, - - { - "EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR END", - "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" , - true, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::END, - false, - textSize34, - 1u, - 13u, - positions34 - }, - - { - "EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR START", - "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" , - true, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::START, - false, - textSize35, - 1u, - 11u, - positions35 - }, - - { - "EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR MIDDLE", - "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" , - true, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::MIDDLE, - false, - textSize36, - 1u, - 12u, - positions36 - }, - - }; - const unsigned int numberOfTests = 39u; - - for( unsigned int index = 0u; index < numberOfTests; ++index ) - { - ToolkitTestApplication application; - if( !ElideTestViewModel( data[index] ) ) - { - tet_result(TET_FAIL); - } - } - - tet_result(TET_PASS); - END_TEST; -} - - -int UtcDaliTextFieldlElideTextLocation(void) -{ - tet_infoline(" UtcDaliTextFieldlElideTextLocation "); - - Size textSize00( 100.f, 100.f ); - - Size textSize01( 120.0f, 50.0f ); - float positions01[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 91.0f }; - - Size textSize02( 120.0f, 50.0f ); - float positions02[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 84.0f, 93.0f }; - - Size textSize03( 120.0f, 50.0f ); - float positions03[] = { 117.0f, 111.0f, 97.0f, 88.0f, 80.0f, 74.0f, 64.0f, 59.0f, 54.0f, 45.0f, 37.0f, 31.0f, 22.0f, 7.0f }; - - Size textSize04( 120.0f, 50.0f ); - float positions04[] = { 5.0f, 21.0f, 31.0f, 41.0f, 50.0f, 61.0f, 71.0f, 80.0f, 90.0f, 100.0f, 109.0f }; - - Size textSize05( 120.0f, 50.0f ); - float positions05[] = { 8.0f, 24.0f, 35.0f, 44.0f, 49.0f, 63.0f, 74.0f, 77.0f, 85.0f, 96.0f, 110.0f }; - - Size textSize06( 120.0f, 50.0f ); - float positions06[] = { 90.0f, 79.0f, 70.0f, 68.0f, 62.0f, 56.0f, 51.0f, 42.0f, 29.0f, 26.0f, 15.0f, 7.0f, 0.0f }; - - Size textSize07( 120.0f, 50.0f ); - float positions07[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 53.0f }; - - Size textSize08( 120.0f, 50.0f ); - float positions08[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f }; - - Size textSize09( 120.0f, 50.0f ); - float positions09[] = { 116.0f, 109.0f, 96.0f, 87.0f, 79.0f, 73.0f, 63.0f }; - - Size textSize10( 120.0f, 50.0f ); - float positions10[] = { 121.0f, 116.0f, 111.0f, 106.0f, 101.0f, 96.0f, 92.0f, 87.0f, 83.0f, 77.0f, 63.0f, 55.0f, 46.0f, 40.0f, 30.0f, 16.0f }; - - Size textSize11( 120.0f, 50.0f ); - float positions11[] = { 93.0f, 77.0f, 74.0f, 63.0f, 56.0f, 49.0f, 44.0f, 39.0f, 34.0f, 29.0f, 24.0f, 19.0f, 14.0f, 9.0f, 5.0f }; - - Size textSize12( 120.0f, 50.0f ); - float positions12[] = { 117.0f, 112.0f, 107.0f, 102.0f, 97.0f, 92.0f, 87.0f, 82.0f, 79.0f, 72.0f }; - - struct ElideData data[] = - { - { - "void text", - "", - false, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::END, - false, - textSize00, - 0u, - 0u, - nullptr - }, - - { - "void text", - "", - false, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::START, - false, - textSize00, - 0u, - 0u, - nullptr - }, - - { - "void text", - "", - false, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::MIDDLE, - false, - textSize00, - 0u, - 0u, - nullptr - }, - - { - "EllipsisPosition: TextField: Basic case SingleLine LTR END", - "A0123456789 B0123456789 C0123456789 D0123456789 ", - false, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::END, - false, - textSize01, - 1u, - 10u, - positions01 - }, - - { - "EllipsisPosition: TextField: SingleLine LTR END", - "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" , - false, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::END, - false, - textSize02, - 1u, - 13u, - positions02 - }, - - { - "EllipsisPosition: TextField: SingleLine RTL END", - "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", - false, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::END, - false, - textSize03, - 1u, - 14u, - positions03 - }, - - { - "EllipsisPosition: TextField: Basic case SingleLine LTR START", - "A0123456789 B0123456789 C0123456789 D0123456789 ", - false, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::START, - false, - textSize04, - 1u, - 11u, - positions04 - }, - - { - "EllipsisPosition: TextField: SingleLine LTR START", - "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" , - false, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::START, - false, - textSize05, - 1u, - 11u, - positions05 - }, - - { - "EllipsisPosition: TextField: SingleLine RTL START", - "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", - false, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::START, - false, - textSize06, - 1u, - 13u, - positions06 - }, - - { - "EllipsisPosition: TextField: Basic case SingleLine LTR MIDDLE", - "A0123456789 B0123456789 C0123456789 D0123456789 ", - false, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::MIDDLE, - false, - textSize07, - 1u, - 11u, - positions07 - }, - - { - "EllipsisPosition: TextField: SingleLine LTR MIDDLE", - "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" , - false, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::MIDDLE, - false, - textSize08, - 1u, - 13u, - positions08 - }, - - { - "EllipsisPosition: TextField: SingleLine RTL MIDDLE", - "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", - false, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::MIDDLE, - false, - textSize09, - 1u, - 13u, - positions09 - }, - - { - "EllipsisPosition: TextField: Head and Tail whitespaces RTL END", - " السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة ", - false, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::END, - false, - textSize10, - 1u, - 16u, - positions10 - }, - - { - "EllipsisPosition: TextField: Head and Tail whitespaces RTL START", - " السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة ", - false, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::START, - false, - textSize11, - 1u, - 15u, - positions11 - }, - - { - "EllipsisPosition: TextField: Head and Tail whitespaces RTL MIDDLE", - " السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة ", - false, - DevelText::LineWrap::WORD, - DevelText::EllipsisPosition::MIDDLE, - false, - textSize12, - 1u, - 20u, - positions12 - }, - - }; - - const unsigned int numberOfTests = 15u; + {"void text", + "", + false, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::END, + false, + textSize00, + 0u, + 0u, + nullptr}, + + {"void text", + "", + false, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::START, + false, + textSize00, + 0u, + 0u, + nullptr}, + + {"void text", + "", + false, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::MIDDLE, + false, + textSize00, + 0u, + 0u, + nullptr}, + + {"EllipsisPosition: TextField: Basic case SingleLine LTR END", + "A0123456789 B0123456789 C0123456789 D0123456789 ", + false, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::END, + false, + textSize01, + 1u, + 10u, + positions01}, + + {"EllipsisPosition: TextField: SingleLine LTR END", + "Hello Hi Experimen Welcome Hello Hi Experimen Welcome", + false, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::END, + false, + textSize02, + 1u, + 13u, + positions02}, + + {"EllipsisPosition: TextField: SingleLine RTL END", + "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", + false, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::END, + false, + textSize03, + 1u, + 14u, + positions03}, + + {"EllipsisPosition: TextField: Basic case SingleLine LTR START", + "A0123456789 B0123456789 C0123456789 D0123456789 ", + false, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::START, + false, + textSize04, + 1u, + 11u, + positions04}, + + {"EllipsisPosition: TextField: SingleLine LTR START", + "Hello Hi Experimen Welcome Hello Hi Experimen Welcome", + false, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::START, + false, + textSize05, + 1u, + 11u, + positions05}, + + {"EllipsisPosition: TextField: SingleLine RTL START", + "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", + false, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::START, + false, + textSize06, + 1u, + 13u, + positions06}, + + {"EllipsisPosition: TextField: Basic case SingleLine LTR MIDDLE", + "A0123456789 B0123456789 C0123456789 D0123456789 ", + false, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::MIDDLE, + false, + textSize07, + 1u, + 11u, + positions07}, + + {"EllipsisPosition: TextField: SingleLine LTR MIDDLE", + "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye", + false, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::MIDDLE, + false, + textSize08, + 1u, + 13u, + positions08}, + + {"EllipsisPosition: TextField: SingleLine RTL MIDDLE", + "السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة", + false, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::MIDDLE, + false, + textSize09, + 1u, + 13u, + positions09}, + + {"EllipsisPosition: TextField: Head and Tail whitespaces RTL END", + " السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة ", + false, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::END, + false, + textSize10, + 1u, + 16u, + positions10}, + + {"EllipsisPosition: TextField: Head and Tail whitespaces RTL START", + " السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة ", + false, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::START, + false, + textSize11, + 1u, + 15u, + positions11}, + + {"EllipsisPosition: TextField: Head and Tail whitespaces RTL MIDDLE", + " السلام عليكم مرحبا اهلا هذا اختبار شكرا للمساعدة ", + false, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::MIDDLE, + false, + textSize12, + 1u, + 20u, + positions12}, + + {"EllipsisPosition: TextField: Mixed Directions Languages END", + "سیٹنگیں Projector سیٹنگیں", + false, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::END, + false, + textSize13, + 1u, + 16, + positions13}, + + {"EllipsisPosition: TextField: Mixed Directions Languages START", + "سیٹنگیں Projector سیٹنگیں", + false, + DevelText::LineWrap::WORD, + DevelText::EllipsisPosition::START, + false, + textSize14, + 1u, + 17, + positions14}, + + }; + + const unsigned int numberOfTests = 17u; for( unsigned int index = 0u; index < numberOfTests; ++index ) { diff --git a/build/tizen/dali-scene-loader/CMakeLists.txt b/build/tizen/dali-scene-loader/CMakeLists.txt index 8891e9d..f900b5a 100644 --- a/build/tizen/dali-scene-loader/CMakeLists.txt +++ b/build/tizen/dali-scene-loader/CMakeLists.txt @@ -64,7 +64,7 @@ if (ENABLE_PKG_CONFIGURE) set(PREFIX ${prefix}) set(EXEC_PREFIX ${CMAKE_INSTALL_PREFIX}) - set(DEV_INCLUDE_PATH ${repo_root_dir}) + set(DEV_INCLUDE_PATH ${INCLUDE_DIR}) set(core_pkg_cfg_file dali2-scene-loader.pc) configure_file(${CMAKE_CURRENT_LIST_DIR}/${core_pkg_cfg_file}.in ${core_pkg_cfg_file} @ONLY) diff --git a/dali-toolkit/internal/graphics/shaders/animated-gradient-visual-shader.vert b/dali-toolkit/internal/graphics/shaders/animated-gradient-visual-shader.vert index e5cbaa7..5faf423 100644 --- a/dali-toolkit/internal/graphics/shaders/animated-gradient-visual-shader.vert +++ b/dali-toolkit/internal/graphics/shaders/animated-gradient-visual-shader.vert @@ -36,9 +36,9 @@ uniform mediump vec2 anchorPoint; vec4 ComputeVertexPosition() { - vec2 visualSize = mix( uSize.xy*size, size, offsetSizeMode.zw ); - vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy ); - return vec4( (aPosition + anchorPoint)*visualSize + (visualOffset + origin)*uSize.xy, 0.0, 1.0 ); + vec2 visualSize = mix(size * uSize.xy, size, offsetSizeMode.zw ); + vec2 visualOffset = mix(offset * uSize.xy, offset, offsetSizeMode.xy ); + return vec4( (aPosition + anchorPoint)*visualSize + visualOffset + origin * uSize.xy, 0.0, 1.0 ); } void main() diff --git a/dali-toolkit/internal/graphics/shaders/arc-visual-shader.vert b/dali-toolkit/internal/graphics/shaders/arc-visual-shader.vert index e063d81..4f6dab5 100644 --- a/dali-toolkit/internal/graphics/shaders/arc-visual-shader.vert +++ b/dali-toolkit/internal/graphics/shaders/arc-visual-shader.vert @@ -13,10 +13,10 @@ uniform mediump vec2 anchorPoint; vec4 ComputeVertexPosition() { - vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw ); - vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy); + vec2 visualSize = mix(size * uSize.xy, size, offsetSizeMode.zw ); + vec2 visualOffset = mix(offset * uSize.xy, offset, offsetSizeMode.xy); vPosition = aPosition* visualSize; - return vec4( vPosition + anchorPoint*visualSize + (visualOffset + origin)*uSize.xy, 0.0, 1.0 ); + return vec4( vPosition + anchorPoint*visualSize + visualOffset + origin * uSize.xy, 0.0, 1.0 ); } void main() diff --git a/dali-toolkit/internal/graphics/shaders/border-visual-shader.vert b/dali-toolkit/internal/graphics/shaders/border-visual-shader.vert index 6dc0721..6bf08fa 100644 --- a/dali-toolkit/internal/graphics/shaders/border-visual-shader.vert +++ b/dali-toolkit/internal/graphics/shaders/border-visual-shader.vert @@ -14,9 +14,9 @@ uniform mediump vec2 anchorPoint; vec2 ComputeVertexPosition() { - vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw ); - vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy); - return (aPosition + anchorPoint)*visualSize + (visualOffset + origin)*uSize.xy; + vec2 visualSize = mix(size * uSize.xy, size, offsetSizeMode.zw ); + vec2 visualOffset = mix(offset * uSize.xy, offset, offsetSizeMode.xy); + return (aPosition + anchorPoint)*visualSize + visualOffset + origin * uSize.xy; } void main() diff --git a/dali-toolkit/internal/graphics/shaders/color-visual-shader.vert b/dali-toolkit/internal/graphics/shaders/color-visual-shader.vert index ea72bab..f1688da 100644 --- a/dali-toolkit/internal/graphics/shaders/color-visual-shader.vert +++ b/dali-toolkit/internal/graphics/shaders/color-visual-shader.vert @@ -32,8 +32,8 @@ uniform mediump vec2 extraSize; vec4 ComputeVertexPosition() { - vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw ) + extraSize; - vec2 visualOffset = mix(offset, offset/uSize.xy, offsetSizeMode.xy); + vec2 visualSize = mix(size * uSize.xy, size, offsetSizeMode.zw ) + extraSize; + vec2 visualOffset = mix(offset * uSize.xy, offset, offsetSizeMode.xy); #if defined(IS_REQUIRED_ROUNDED_CORNER) || defined(IS_REQUIRED_BORDERLINE) || defined(IS_REQUIRED_BLUR) vRectSize = visualSize * 0.5; @@ -64,7 +64,7 @@ vec4 ComputeVertexPosition() #else mediump vec2 vPosition = aPosition * visualSize; #endif - return vec4(vPosition + anchorPoint * visualSize + (visualOffset + origin) * uSize.xy, 0.0, 1.0); + return vec4(vPosition + anchorPoint * visualSize + visualOffset + origin * uSize.xy, 0.0, 1.0); } void main() diff --git a/dali-toolkit/internal/graphics/shaders/gradient-visual-shader.vert b/dali-toolkit/internal/graphics/shaders/gradient-visual-shader.vert index 9ea1a17..68179ab 100644 --- a/dali-toolkit/internal/graphics/shaders/gradient-visual-shader.vert +++ b/dali-toolkit/internal/graphics/shaders/gradient-visual-shader.vert @@ -30,8 +30,8 @@ uniform mediump float cornerRadiusPolicy; vec4 ComputeVertexPosition() { - vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw ); - vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy); + vec2 visualSize = mix(size * uSize.xy, size, offsetSizeMode.zw ); + vec2 visualOffset = mix(offset * uSize.xy, offset, offsetSizeMode.xy); #if defined(IS_REQUIRED_ROUNDED_CORNER) || defined(IS_REQUIRED_BORDERLINE) vRectSize = visualSize * 0.5; @@ -68,7 +68,7 @@ vec4 ComputeVertexPosition() vTexCoord = (uAlignmentMatrix*vertexPosition.xyw).xy; - return vec4(vPosition + anchorPoint * visualSize + (visualOffset + origin) * uSize.xy, 0.0, 1.0); + return vec4(vPosition + anchorPoint * visualSize + visualOffset + origin * uSize.xy, 0.0, 1.0); } void main() diff --git a/dali-toolkit/internal/graphics/shaders/image-visual-shader.vert b/dali-toolkit/internal/graphics/shaders/image-visual-shader.vert index e4db9ee..7443aa1 100644 --- a/dali-toolkit/internal/graphics/shaders/image-visual-shader.vert +++ b/dali-toolkit/internal/graphics/shaders/image-visual-shader.vert @@ -36,8 +36,8 @@ uniform mediump vec2 extraSize; vec4 ComputeVertexPosition() { - vec2 visualSize = mix(uSize.xy * size, size, offsetSizeMode.zw) + extraSize; - vec2 visualOffset = mix(offset, offset/uSize.xy, offsetSizeMode.xy); + vec2 visualSize = mix(size * uSize.xy, size, offsetSizeMode.zw) + extraSize; + vec2 visualOffset = mix(offset * uSize.xy, offset, offsetSizeMode.xy); #if defined(IS_REQUIRED_ROUNDED_CORNER) || defined(IS_REQUIRED_BORDERLINE) vRectSize = visualSize * 0.5; @@ -78,7 +78,7 @@ vec4 ComputeVertexPosition() #endif vTexCoord = finalPixelArea.xy + finalPixelArea.zw * (vPosition.xy / max(vec2(1.0), visualSize) + vec2(0.5)); - return vec4(vPosition + anchorPoint * visualSize + (visualOffset + origin) * uSize.xy, 0.0, 1.0); + return vec4(vPosition + anchorPoint * visualSize + visualOffset + origin * uSize.xy, 0.0, 1.0); } void main() diff --git a/dali-toolkit/internal/graphics/shaders/mesh-visual-normal-map-shader.vert b/dali-toolkit/internal/graphics/shaders/mesh-visual-normal-map-shader.vert index c25a1bb..bc9ac8a 100644 --- a/dali-toolkit/internal/graphics/shaders/mesh-visual-normal-map-shader.vert +++ b/dali-toolkit/internal/graphics/shaders/mesh-visual-normal-map-shader.vert @@ -24,12 +24,12 @@ uniform mediump vec2 anchorPoint; vec4 ComputeVertexPosition() { - vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw ); + vec2 visualSize = mix(size * uSize.xy, size, offsetSizeMode.zw ); float scaleFactor = min( visualSize.x, visualSize.y ); vec3 originFlipY =vec3(origin.x, -origin.y, 0.0); vec3 anchorPointFlipY = vec3( anchorPoint.x, -anchorPoint.y, 0.0); - vec3 offset = vec3( ( offset / uSize.xy ) * offsetSizeMode.xy + offset * (1.0-offsetSizeMode.xy), 0.0) * vec3(1.0,-1.0,1.0); - return vec4( (aPosition + anchorPointFlipY)*scaleFactor + (offset + originFlipY)*uSize, 1.0 ); + vec3 visualOffset = vec3( offset * offsetSizeMode.xy + offset * uSize.xy * (1.0 - offsetSizeMode.xy), 0.0) * vec3(1.0,-1.0,1.0); + return vec4( (aPosition + anchorPointFlipY)*scaleFactor + visualOffset + originFlipY * uSize, 1.0 ); } void main() diff --git a/dali-toolkit/internal/graphics/shaders/mesh-visual-shader.vert b/dali-toolkit/internal/graphics/shaders/mesh-visual-shader.vert index 05b90ce..858c92d 100644 --- a/dali-toolkit/internal/graphics/shaders/mesh-visual-shader.vert +++ b/dali-toolkit/internal/graphics/shaders/mesh-visual-shader.vert @@ -26,8 +26,8 @@ vec4 ComputeVertexPosition() float scaleFactor = min( visualSize.x, visualSize.y ); vec3 originFlipY =vec3(origin.x, -origin.y, 0.0); vec3 anchorPointFlipY = vec3( anchorPoint.x, -anchorPoint.y, 0.0); - vec3 offset = vec3( ( offset / uSize.xy ) * offsetSizeMode.xy + offset * (1.0-offsetSizeMode.xy), 0.0) * vec3(1.0,-1.0,1.0); - return vec4( (aPosition + anchorPointFlipY)*scaleFactor + (offset + originFlipY)*uSize, 1.0 ); + vec3 visualOffset = vec3( offset * offsetSizeMode.xy + offset * uSize.xy * (1.0-offsetSizeMode.xy), 0.0) * vec3(1.0,-1.0,1.0); + return vec4( (aPosition + anchorPointFlipY)*scaleFactor + visualOffset + originFlipY * uSize, 1.0 ); } void main() diff --git a/dali-toolkit/internal/graphics/shaders/mesh-visual-simple-shader.vert b/dali-toolkit/internal/graphics/shaders/mesh-visual-simple-shader.vert index 2a4b704..0541a16 100644 --- a/dali-toolkit/internal/graphics/shaders/mesh-visual-simple-shader.vert +++ b/dali-toolkit/internal/graphics/shaders/mesh-visual-simple-shader.vert @@ -23,8 +23,8 @@ vec4 ComputeVertexPosition() float scaleFactor = min( visualSize.x, visualSize.y ); vec3 originFlipY =vec3(origin.x, -origin.y, 0.0); vec3 anchorPointFlipY = vec3( anchorPoint.x, -anchorPoint.y, 0.0); - vec3 offset = vec3( ( offset / uSize.xy ) * offsetSizeMode.xy + offset * (1.0-offsetSizeMode.xy), 0.0) * vec3(1.0,-1.0,1.0); - return vec4( (aPosition + anchorPointFlipY)*scaleFactor + (offset + originFlipY)*uSize, 1.0 ); + vec3 visualOffset = vec3( offset * offsetSizeMode.xy + offset * uSize.xy * (1.0-offsetSizeMode.xy), 0.0) * vec3(1.0,-1.0,1.0); + return vec4( (aPosition + anchorPointFlipY)*scaleFactor + visualOffset + originFlipY * uSize, 1.0 ); } void main() diff --git a/dali-toolkit/internal/graphics/shaders/npatch-visual-3x3-shader.vert b/dali-toolkit/internal/graphics/shaders/npatch-visual-3x3-shader.vert index c7b8a9f..4625b3c 100644 --- a/dali-toolkit/internal/graphics/shaders/npatch-visual-3x3-shader.vert +++ b/dali-toolkit/internal/graphics/shaders/npatch-visual-3x3-shader.vert @@ -16,8 +16,8 @@ uniform mediump vec2 extraSize; void main() { - vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw ) + extraSize; - vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy); + vec2 visualSize = mix(size * uSize.xy, size, offsetSizeMode.zw ) + extraSize; + vec2 visualOffset = mix(offset * uSize.xy, offset, offsetSizeMode.xy); mediump vec2 size = visualSize.xy; @@ -31,7 +31,7 @@ void main() mediump vec4 gridPosition = vec4( fixedFactor * fixedScaleDownRate + ( size - fixedTotal * fixedScaleDownRate ) * stretch, 0.0, 1.0 ); mediump vec4 vertexPosition = gridPosition; vertexPosition.xy -= size * vec2( 0.5, 0.5 ); - vertexPosition.xy += anchorPoint*size + (visualOffset + origin)*uSize.xy; + vertexPosition.xy += anchorPoint*size + visualOffset + origin * uSize.xy; vertexPosition = uMvpMatrix * vertexPosition; diff --git a/dali-toolkit/internal/graphics/shaders/npatch-visual-shader.vert b/dali-toolkit/internal/graphics/shaders/npatch-visual-shader.vert index 4cd84bc..01f6138 100644 --- a/dali-toolkit/internal/graphics/shaders/npatch-visual-shader.vert +++ b/dali-toolkit/internal/graphics/shaders/npatch-visual-shader.vert @@ -22,8 +22,8 @@ void main() mediump vec2 fixedTotal = vec2( uNinePatchFactorsX[ FACTOR_SIZE_X - 1 ].x, uNinePatchFactorsY[ FACTOR_SIZE_Y - 1 ].x ); mediump vec2 stretchTotal = vec2( uNinePatchFactorsX[ FACTOR_SIZE_X - 1 ].y, uNinePatchFactorsY[ FACTOR_SIZE_Y - 1 ].y ); - vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw ) + extraSize; - vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy); + vec2 visualSize = mix(size * uSize.xy, size, offsetSizeMode.zw ) + extraSize; + vec2 visualOffset = mix(offset * uSize.xy, offset, offsetSizeMode.xy); // Scale down if fixedTotal is bigger than visualSize mediump float fixedScaleDownRate = min(1.0, min(visualSize.x / fixedTotal.x, visualSize.y / fixedTotal.y)); @@ -31,7 +31,7 @@ void main() mediump vec4 gridPosition = vec4( fixedFactor * fixedScaleDownRate + ( visualSize.xy - fixedTotal * fixedScaleDownRate ) * stretch / stretchTotal, 0.0, 1.0 ); mediump vec4 vertexPosition = gridPosition; vertexPosition.xy -= visualSize.xy * vec2( 0.5, 0.5 ); - vertexPosition.xy += anchorPoint*visualSize + (visualOffset + origin)*uSize.xy; + vertexPosition.xy += anchorPoint*visualSize + visualOffset + origin * uSize.xy; vertexPosition = uMvpMatrix * vertexPosition; vTexCoord = ( fixedFactor + stretch ) / ( fixedTotal + stretchTotal ); diff --git a/dali-toolkit/internal/graphics/shaders/primitive-visual-shader.vert b/dali-toolkit/internal/graphics/shaders/primitive-visual-shader.vert index 6a1b758..1200294 100644 --- a/dali-toolkit/internal/graphics/shaders/primitive-visual-shader.vert +++ b/dali-toolkit/internal/graphics/shaders/primitive-visual-shader.vert @@ -27,9 +27,9 @@ vec4 ComputeVertexPosition() float scaleFactor = min( visualSize.x / uObjectDimensions.x, visualSize.y / uObjectDimensions.y ); vec3 originFlipY =vec3(origin.x, -origin.y, 0.0); vec3 anchorPointFlipY = vec3( anchorPoint.x, -anchorPoint.y, 0.0); - vec3 offset = vec3( ( offset / uSize.xy ) * offsetSizeMode.xy + offset * (1.0-offsetSizeMode.xy), 0.0) * vec3(1.0,-1.0,1.0); + vec3 visualOffset = vec3( offset * offsetSizeMode.xy + offset * uSize.xy * (1.0-offsetSizeMode.xy), 0.0) * vec3(1.0,-1.0,1.0); - return vec4( (aPosition + anchorPointFlipY)*scaleFactor + (offset + originFlipY)*uSize, 1.0 ); + return vec4( (aPosition + anchorPointFlipY)*scaleFactor + visualOffset + originFlipY * uSize, 1.0 ); } void main() diff --git a/dali-toolkit/internal/graphics/shaders/text-scroller-shader.vert b/dali-toolkit/internal/graphics/shaders/text-scroller-shader.vert index 6ea160a..c152b5e 100644 --- a/dali-toolkit/internal/graphics/shaders/text-scroller-shader.vert +++ b/dali-toolkit/internal/graphics/shaders/text-scroller-shader.vert @@ -18,13 +18,13 @@ uniform mediump vec2 anchorPoint; void main() { - highp vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy ); - highp vec2 visualSize = mix( uSize.xy * size, size, offsetSizeMode.zw ); + highp vec2 visualSize = mix(size * uSize.xy, size, offsetSizeMode.zw); + highp vec2 visualOffset = mix(offset * uSize.xy, offset, offsetSizeMode.xy); vTexCoord.x = ( uDelta + uHorizontalAlign * ( uTextureSize.x - visualSize.x - uGap ) + aPosition.x * visualSize.x - uGap * 0.5 ) / uTextureSize.x + 0.5; vTexCoord.y = ( uVerticalAlign * ( uTextureSize.y - visualSize.y ) + aPosition.y * visualSize.y ) / ( uTextureSize.y ) + 0.5; - highp vec4 vertexPosition = vec4( ( aPosition + anchorPoint ) * visualSize + ( visualOffset + origin ) * uSize.xy, 0.0, 1.0 ); + highp vec4 vertexPosition = vec4( ( aPosition + anchorPoint ) * visualSize + visualOffset + origin * uSize.xy, 0.0, 1.0 ); gl_Position = uMvpMatrix * vertexPosition; } \ No newline at end of file diff --git a/dali-toolkit/internal/graphics/shaders/text-visual-shader.vert b/dali-toolkit/internal/graphics/shaders/text-visual-shader.vert index 893d075..4cc1212 100644 --- a/dali-toolkit/internal/graphics/shaders/text-visual-shader.vert +++ b/dali-toolkit/internal/graphics/shaders/text-visual-shader.vert @@ -14,9 +14,9 @@ uniform mediump vec2 anchorPoint; vec4 ComputeVertexPosition() { - vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw ); - vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy); - return vec4( (aPosition + anchorPoint)*visualSize + (visualOffset + origin)*uSize.xy, 0.0, 1.0 ); + vec2 visualSize = mix(size * uSize.xy, size, offsetSizeMode.zw ); + vec2 visualOffset = mix(offset * uSize.xy, offset, offsetSizeMode.xy); + return vec4( (aPosition + anchorPoint) * visualSize + visualOffset + origin * uSize.xy, 0.0, 1.0 ); } void main() diff --git a/dali-toolkit/internal/graphics/shaders/wireframe-visual-shader.vert b/dali-toolkit/internal/graphics/shaders/wireframe-visual-shader.vert index 5e0bfb0..9a9975c 100644 --- a/dali-toolkit/internal/graphics/shaders/wireframe-visual-shader.vert +++ b/dali-toolkit/internal/graphics/shaders/wireframe-visual-shader.vert @@ -11,9 +11,9 @@ uniform mediump vec2 anchorPoint; vec4 ComputeVertexPosition() { - vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw ); - vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy); - return vec4( (aPosition + anchorPoint)*visualSize + (visualOffset + origin)*uSize.xy, 0.0, 1.0 ); + vec2 visualSize = mix(size * uSize.xy, size, offsetSizeMode.zw ); + vec2 visualOffset = mix(offset * uSize.xy, offset, offsetSizeMode.xy); + return vec4( (aPosition + anchorPoint)*visualSize + visualOffset + origin * uSize.xy, 0.0, 1.0 ); } void main() diff --git a/dali-toolkit/internal/text/markup-processor.cpp b/dali-toolkit/internal/text/markup-processor.cpp index 60eb03b..1047411 100644 --- a/dali-toolkit/internal/text/markup-processor.cpp +++ b/dali-toolkit/internal/text/markup-processor.cpp @@ -941,7 +941,7 @@ void ResizeModelVectors(MarkupProcessData& markupProcessData, markupProcessData.characterSpacingCharacterRuns.Resize(characterSpacingCharacterRunIndex); #ifdef DEBUG_ENABLED - for(unsigned int i = 0; i < colorRunIndex; ++i) + for(uint32_t i = 0; gLogFilter->IsEnabledFor(Debug::Verbose) && i < colorRunIndex; ++i) { ColorRun& run = markupProcessData.colorRuns[i]; DALI_LOG_INFO(gLogFilter, Debug::Verbose, "run[%d] index: %d, length: %d, color %f,%f,%f,%f\n", i, run.characterRun.characterIndex, run.characterRun.numberOfCharacters, run.color.r, run.color.g, run.color.b, run.color.a); diff --git a/dali-toolkit/internal/text/multi-language-support-impl.cpp b/dali-toolkit/internal/text/multi-language-support-impl.cpp index dbd110b..52f2b18 100644 --- a/dali-toolkit/internal/text/multi-language-support-impl.cpp +++ b/dali-toolkit/internal/text/multi-language-support-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -500,6 +500,7 @@ void MultilanguageSupport::ValidateFonts(const Vector& scriptRunEndIt); #ifdef DEBUG_ENABLED + if(gLogFilter->IsEnabledFor(Debug::Verbose)) { Dali::TextAbstraction::FontDescription description; fontClient.GetDescription(fontId, description); @@ -716,6 +717,7 @@ void MultilanguageSupport::ValidateFonts(const Vector& } #ifdef DEBUG_ENABLED + if(gLogFilter->IsEnabledFor(Debug::Verbose)) { Dali::TextAbstraction::FontDescription description; fontClient.GetDescription(fontId, description); diff --git a/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp b/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp index e30564e..847954f 100644 --- a/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp +++ b/dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp @@ -221,7 +221,7 @@ struct AtlasRenderer::Impl glyphBufferData.width, glyphBufferData.height, glyphBufferData.format, - PixelData::DELETE_ARRAY); + PixelData::FREE); if(bitmap) { @@ -782,7 +782,7 @@ struct AtlasRenderer::Impl DALI_LOG_INFO(gLogFilter, Debug::Verbose, "%s\n", metrics.mVerboseGlyphCounts.c_str()); - for(uint32_t i = 0; i < metrics.mAtlasMetrics.mAtlasCount; ++i) + for(uint32_t i = 0; gLogFilter->IsEnabledFor(Debug::Verbose) && i < metrics.mAtlasMetrics.mAtlasCount; ++i) { DALI_LOG_INFO(gLogFilter, Debug::Verbose, " Atlas [%i] %sPixels: %s Size: %ix%i, BlockSize: %ix%i, BlocksUsed: %i/%i\n", i + 1, i > 8 ? "" : " ", metrics.mAtlasMetrics.mAtlasMetrics[i].mPixelFormat == Pixel::L8 ? "L8 " : "BGRA", metrics.mAtlasMetrics.mAtlasMetrics[i].mSize.mWidth, metrics.mAtlasMetrics.mAtlasMetrics[i].mSize.mHeight, metrics.mAtlasMetrics.mAtlasMetrics[i].mSize.mBlockWidth, metrics.mAtlasMetrics.mAtlasMetrics[i].mSize.mBlockHeight, metrics.mAtlasMetrics.mAtlasMetrics[i].mBlocksUsed, metrics.mAtlasMetrics.mAtlasMetrics[i].mTotalBlocks); } diff --git a/dali-toolkit/internal/text/rendering/text-typesetter.cpp b/dali-toolkit/internal/text/rendering/text-typesetter.cpp index 2689ffb..da397ac 100644 --- a/dali-toolkit/internal/text/rendering/text-typesetter.cpp +++ b/dali-toolkit/internal/text/rendering/text-typesetter.cpp @@ -1307,8 +1307,8 @@ Devel::PixelBuffer Typesetter::CreateImageBuffer(const uint32_t& bufferWidth, co glyphData.verticalOffset += glyphData.glyphBitmap.outlineOffsetY; } - // delete the glyphBitmap.buffer as it is now copied into glyphData.bitmapBuffer - delete[] glyphData.glyphBitmap.buffer; + // free the glyphBitmap.buffer as it is now copied into glyphData.bitmapBuffer + free(glyphData.glyphBitmap.buffer); glyphData.glyphBitmap.buffer = NULL; } diff --git a/dali-toolkit/internal/text/rendering/view-model.cpp b/dali-toolkit/internal/text/rendering/view-model.cpp index f02bb95..9cfba93 100644 --- a/dali-toolkit/internal/text/rendering/view-model.cpp +++ b/dali-toolkit/internal/text/rendering/view-model.cpp @@ -524,7 +524,71 @@ void ViewModel::ElideGlyphs() // Change the 'x' and 'y' position of the ellipsis glyph. if(position.x > firstPenX) { - position.x = firstPenX + removedGlypsWidth - ellipsisGlyphWidth; + if(isTailMode) + { + // To handle case of the mixed languages (LTR then RTL) with + // EllipsisPosition::END and the LayoutDirection::RIGHT_TO_LEFT + float nextXPositions = ellipsisLine->width; + if(indexOfEllipsis + 1u < numberOfGlyphs) + { + Vector2& positionOfNextGlyph = *(elidedPositionsBuffer + indexOfEllipsis + 1u); + nextXPositions = positionOfNextGlyph.x; + } + + if(position.x > nextXPositions) // RTL language + { + if((indexOfEllipsis > 0u) && ((position.x - nextXPositions) > removedGlypsWidth)) + { + // To handle mixed directions + // Re-calculates the first penX which will be used if rtl text is elided. + firstPenX = position.x - glyphToRemove.xBearing; + if(firstPenX < -ellipsisGlyph.xBearing) + { + // Avoids to exceed the bounding box when rtl text is elided. + firstPenX = -ellipsisGlyph.xBearing; + } + //Reset the width of removed glyphs + removedGlypsWidth = std::min(calculatedAdvance, (glyphToRemove.xBearing + glyphToRemove.width)) - ellipsisGlyph.xBearing; + + --indexOfEllipsis; + continue; + } + else + { + // To handle the case of RTL language with EllipsisPosition::END + position.x = firstPenX + removedGlypsWidth - ellipsisGlyphWidth; + } + } + } + else + { + // To handle the case of LTR language with EllipsisPosition::START + position.x = firstPenX + removedGlypsWidth - ellipsisGlyphWidth; + } + } + else + { + if(!isTailMode) + { + // To handle case of the mixed languages (RTL then LTR) with + // EllipsisPosition::START and the LayoutDirection::RIGHT_TO_LEFT + float nextXPositions = ellipsisLine->width; + if(indexOfEllipsis + 1u < numberOfGlyphs) + { + Vector2& positionOfNextGlyph = *(elidedPositionsBuffer + indexOfEllipsis + 1u); + nextXPositions = positionOfNextGlyph.x; + } + + if(position.x < nextXPositions) // LTR language + { + position.x = firstPenX + removedGlypsWidth - ellipsisGlyphWidth; + + if((position.x + ellipsisGlyphWidth + ellipsisGlyph.xBearing) > nextXPositions) + { + position.x -= (position.x + ellipsisGlyphWidth + ellipsisGlyph.xBearing) - nextXPositions; + } + } + } } position.x += ellipsisGlyph.xBearing; diff --git a/dali-toolkit/internal/text/text-view.cpp b/dali-toolkit/internal/text/text-view.cpp index 9c067de..0be5ac6 100644 --- a/dali-toolkit/internal/text/text-view.cpp +++ b/dali-toolkit/internal/text/text-view.cpp @@ -376,10 +376,73 @@ Length View::GetGlyphs(GlyphInfo* glyphs, glyphInfo = ellipsisGlyph; // Change the 'x' and 'y' position of the ellipsis glyph. - if(position.x > firstPenX) { - position.x = firstPenX + removedGlypsWidth - ellipsisGlyphWidth; + if(isTailMode) + { + // To handle case of the mixed languages (LTR then RTL) with + // EllipsisPosition::END and the LayoutDirection::RIGHT_TO_LEFT + float nextXPositions = ellipsisLine->width; + if(indexOfEllipsis + 1u < numberOfGlyphs) + { + Vector2& positionOfNextGlyph = *(glyphPositions + indexOfEllipsis + 1u); + nextXPositions = positionOfNextGlyph.x; + } + + if(position.x > nextXPositions) // RTL language + { + if((indexOfEllipsis > 0u) && ((position.x - nextXPositions) > removedGlypsWidth)) + { + // To handle mixed directions + // Re-calculates the first penX which will be used if rtl text is elided. + firstPenX = position.x - glyphToRemove.xBearing; + if(firstPenX < -ellipsisGlyph.xBearing) + { + // Avoids to exceed the bounding box when rtl text is elided. + firstPenX = -ellipsisGlyph.xBearing; + } + //Reset the width of removed glyphs + removedGlypsWidth = std::min(calculatedAdvance, (glyphToRemove.xBearing + glyphToRemove.width)) - ellipsisGlyph.xBearing; + + --indexOfEllipsis; + continue; + } + else + { + // To handle the case of RTL language with EllipsisPosition::END + position.x = firstPenX + removedGlypsWidth - ellipsisGlyphWidth; + } + } + } + else + { + // To handle the case of LTR language with EllipsisPosition::START + position.x = firstPenX + removedGlypsWidth - ellipsisGlyphWidth; + } + } + else + { + if(!isTailMode) + { + // To handle case of the mixed languages (RTL then LTR) with + // EllipsisPosition::START and the LayoutDirection::RIGHT_TO_LEFT + float nextXPositions = ellipsisLine->width; + if(indexOfEllipsis + 1u < numberOfGlyphs) + { + Vector2& positionOfNextGlyph = *(glyphPositions + indexOfEllipsis + 1u); + nextXPositions = positionOfNextGlyph.x; + } + + if(position.x < nextXPositions) // LTR language + { + position.x = firstPenX + removedGlypsWidth - ellipsisGlyphWidth; + + if((position.x + ellipsisGlyphWidth + ellipsisGlyph.xBearing) > nextXPositions) + { + position.x -= (position.x + ellipsisGlyphWidth + ellipsisGlyph.xBearing) - nextXPositions; + } + } + } } position.x += ellipsisGlyph.xBearing; diff --git a/dali-toolkit/internal/visuals/animated-image/rolling-animated-image-cache.cpp b/dali-toolkit/internal/visuals/animated-image/rolling-animated-image-cache.cpp index c430320..74ec088 100644 --- a/dali-toolkit/internal/visuals/animated-image/rolling-animated-image-cache.cpp +++ b/dali-toolkit/internal/visuals/animated-image/rolling-animated-image-cache.cpp @@ -28,6 +28,7 @@ namespace Debug::Filter* gAnimImgLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_ANIMATED_IMAGE"); #define LOG_CACHE \ + if(gAnimImgLogFilter->IsEnabledFor(Debug::Concise)) \ { \ std::ostringstream oss; \ oss << "Size:" << mQueue.Count() << " [ "; \ @@ -194,7 +195,7 @@ TextureSet RollingAnimatedImageCache::RequestFrameLoading(uint32_t frameIndex, b mLoadState = TextureManager::LoadState::LOADING; auto preMultiplyOnLoading = mPreMultiplyOnLoad ? TextureManager::MultiplyOnLoad::MULTIPLY_ON_LOAD - : TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY; + : TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY; TextureManager::TextureId loadTextureId = TextureManager::INVALID_TEXTURE_ID; TextureSet textureSet = mTextureManager.LoadAnimatedImageTexture(mImageUrl, diff --git a/dali-toolkit/internal/visuals/animated-image/rolling-image-cache.cpp b/dali-toolkit/internal/visuals/animated-image/rolling-image-cache.cpp index f78d74a..7a84f5b 100644 --- a/dali-toolkit/internal/visuals/animated-image/rolling-image-cache.cpp +++ b/dali-toolkit/internal/visuals/animated-image/rolling-image-cache.cpp @@ -29,6 +29,7 @@ namespace Debug::Filter* gAnimImgLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_ANIMATED_IMAGE"); #define LOG_CACHE \ + if(gAnimImgLogFilter->IsEnabledFor(Debug::Concise)) \ { \ std::ostringstream oss; \ oss << "Size:" << mQueue.Count() << " [ "; \ diff --git a/dali-toolkit/internal/visuals/visual-base-impl.cpp b/dali-toolkit/internal/visuals/visual-base-impl.cpp index ab8f434..b50cc59 100644 --- a/dali-toolkit/internal/visuals/visual-base-impl.cpp +++ b/dali-toolkit/internal/visuals/visual-base-impl.cpp @@ -1030,6 +1030,7 @@ void Visual::Base::AnimateProperty( Internal::TransitionData::Animator& animator) { #if defined(DEBUG_ENABLED) + if(gVisualBaseLogFilter->IsEnabledFor(Debug::General)) { std::ostringstream oss; oss << "Visual::Base::AnimateProperty(Visual:" << mImpl->mName << " Property:" << animator.propertyKey << " Target: " << animator.targetValue << std::endl;