evas_object_text: fix text ellipsis issue 67/284467/3
authorBowon Ryu <bowon.ryu@samsung.com>
Thu, 17 Nov 2022 11:42:15 +0000 (20:42 +0900)
committerBowon Ryu <bowon.ryu@samsung.com>
Thu, 17 Nov 2022 12:12:27 +0000 (12:12 +0000)
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 <bowon.ryu@samsung.com>
src/lib/evas/canvas/evas_object_text.c

index 174ed6b..cb3d297 100644 (file)
@@ -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;