From 6895f55a6cf786fed9e6af53a3864b957af8f883 Mon Sep 17 00:00:00 2001 From: Bowon Ryu Date: Thu, 17 Nov 2022 20:42:15 +0900 Subject: [PATCH] evas_object_text: fix text ellipsis issue When the size of the text item and the ellip frame are same and if it fails to find the cut, we should find the cut in the next item. Change-Id: I2e55d51d5dc0c63c1159f52a2e88b2987080ab1d Signed-off-by: Bowon Ryu --- src/lib/evas/canvas/evas_object_text.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index 174ed6b..cb3d297 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -1017,6 +1017,22 @@ _evas_object_text_layout(Evas_Object *eo_obj, Evas_Text_Data *o, Eina_Unicode *t &itr->text_props, ellip_frame - (advance + l + r), 0, end_ellip_it->w); + /* TIZEN_ONLY(20221117): When the size of the text item and the ellip frame are same + and if it fails to find the cut, we should find the cut in the next item. */ + if (cut == -1 && advance + l + r + EVAS_TEXT_ITEM_SIZE(itr) == ellip_frame && itr->text_props.text_len > 0) + { + advance += itr->adv; + itr = (Evas_Object_Text_Item *) EINA_INLIST_GET(itr)->next; + if (itr && (itr != end_ellip_it)) + { + cut = ENFN->font_last_up_to_pos(ENC, + o->font, + &itr->text_props, + ellip_frame - (advance + l + r), + 0, end_ellip_it->w); + } + } + /* END */ if (cut >= 0) { end_ellip_it->text_pos = itr->text_pos + cut; -- 2.7.4