From: Joogab Yun Date: Mon, 11 Feb 2019 04:13:53 +0000 (+0900) Subject: Fixed an incorrect ellipsis X-Git-Tag: dali_1.4.9~2^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=a3481a2c7f2a780cb74c9396fc23afa3d72b2642;hp=46a27bd33d7dc6ef7844b63399dbdfcb2ebb55d7 Fixed an incorrect ellipsis ex) An ellipsis may be displayed incorrectly when there are two or more new-line characters. TextLabel labe34 = TextLabel::New( "yesterday all my troubles seemed so\n\n\n\n far away now it looks" ); labe34.SetSize( 450, 100 ); labe34.SetParentOrigin(ParentOrigin::TOP_LEFT); labe34.SetAnchorPoint(AnchorPoint::TOP_LEFT); labe34.SetPosition( 100.f, 500.f); labe34.SetProperty(TextLabel::Property::POINT_SIZE, 17.6f); labe34.SetProperty( TextLabel::Property::MULTI_LINE, true ); labe34.SetProperty(TextLabel::Property::ELLIPSIS, true); stage.Add( labe34 ); Change-Id: Ib04a4846eb7a431164913e298dc634561842ba3f --- diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-ViewModel.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-ViewModel.cpp old mode 100644 new mode 100755 index 35105d1..66e2682 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-ViewModel.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-ViewModel.cpp @@ -586,10 +586,10 @@ int UtcDaliTextViewModelElideText02(void) float positions01[] = { 0.f, 8.f, 16.f, 26.f, 33.f, 41.f, 45.f, 54.f, 64.0f }; Size textSize02( 80.f, 100.f ); - float positions02[] = { 72.f, 63.f, 54.f, 50.f, 43.f, 38.f, 30.f, 9.0f }; + float positions02[] = { 72.f, 63.f, 54.f, 50.f, 43.f, 38.f, 30.f, 23.0f }; Size textSize03( 80.f, 100.f ); - float positions03[] = { 78.f, 73.f, 70.f, 65.f, 57.f, 55.f, 51.f, 50.f, 45.f, 35.f, 32.f, 24.f, 7.f }; + float positions03[] = { 78.f, 73.f, 70.f, 65.f, 57.f, 55.f, 51.f, 50.f, 45.f, 35.f, 32.f, 24.f, 21.f }; Size textSize04( 80.f, 10.f ); float positions04[] = { 2.f }; diff --git a/dali-toolkit/internal/text/rendering/view-model.cpp b/dali-toolkit/internal/text/rendering/view-model.cpp index 3543fce..70b642f 100755 --- a/dali-toolkit/internal/text/rendering/view-model.cpp +++ b/dali-toolkit/internal/text/rendering/view-model.cpp @@ -332,12 +332,6 @@ void ViewModel::ElideGlyphs() glyphInfo = ellipsisGlyph; // Change the 'x' and 'y' position of the ellipsis glyph. - - if( position.x > firstPenX ) - { - position.x = firstPenX + removedGlypsWidth - ellipsisGlyphWidth; - } - position.x += ellipsisGlyph.xBearing; position.y = penY - ellipsisGlyph.yBearing;