#define COL_OBJECT(obj, sub) ARGB_JOIN(obj->sub->color.a, obj->sub->color.r, obj->sub->color.g, obj->sub->color.b)
#define COL_JOIN(o, sub, color) ARGB_JOIN(o->sub.color.a, o->sub.color.r, o->sub.color.g, o->sub.color.b)
+/* TIZEN_ONLY(20161007): Apply the last character's advance for width calculation */
+#define EVAS_TEXT_ITEM_SIZE(it) \
+ ((it->w > it->adv) ? it->w : it->adv)
+/* END */
+
+
/* private magic number for text objects */
static const char o_type[] = "text";
script_len -= run_len;
len -= run_len;
+ /* TIZEN_ONLY(20161007): Apply the last character's advance for width calculation
if (it->w > 0)
last_it = it;
+ */
+ if ((it->w > 0) || (it->adv > 0))
+ last_it = it;
+ /* END */
}
}
width = advance;
+ /* TIZEN_ONLY(20161007): Apply the last character's advance for width calculation
if (last_it)
width += last_it->w - last_it->adv;
+ */
+ if (last_it && (last_it->w > last_it->adv))
+ width += last_it->w - last_it->adv;
+ /* END */
}
o->last_computed.width_without_ellipsis = width;
start_ellip_it = _layout_ellipsis_item_new(obj, o);
}
o->last_computed.ellipsis_start = start_ellip_it;
+ /* TIZEN_ONLY(20161007): Apply the last character's advance for width calculation
ellip_frame -= start_ellip_it->w;
+ */
+ ellip_frame -= EVAS_TEXT_ITEM_SIZE(start_ellip_it);
+ /* END */
}
if (o->cur.ellipsis != 1)
{
}
o->last_computed.ellipsis_end = end_ellip_it;
ellip_frame -= end_ellip_it->w;
+ /* TIZEN_ONLY(20161007): Apply the last character's advance for width calculation
+ ellip_frame -= end_ellip_it->w;
+ */
+ ellip_frame -= EVAS_TEXT_ITEM_SIZE(end_ellip_it);
+ /* END */
}
/* The point where we should start from, going for the full
Evas_Object_Text_Item *itr = o->items;
advance = 0;
+ /* TIZEN_ONLY(20161007): Apply the last character's advance for width calculation
while (itr && (advance + l + r + itr->w < ellipsis_coord))
+ */
+ while (itr && (advance + l + r + EVAS_TEXT_ITEM_SIZE(itr) < ellipsis_coord))
+ /* END */
{
Eina_Inlist *itrn = EINA_INLIST_GET(itr)->next;
if ((itr != start_ellip_it) && (itr != end_ellip_it))
{
if (itr != end_ellip_it) /* was start_ellip_it */
{
+ /* TIZEN_ONLY(20161007): Apply the last character's advance for width calculation
if (advance + l + r + itr->w >= ellip_frame)
+ */
+ if (advance + l + r + EVAS_TEXT_ITEM_SIZE(itr) >= ellip_frame)
+ /* END */
{
break;
}
((ch) == _PARAGRAPH_SEPARATOR))
/* END */
+/* TIZEN_ONLY(20161007): Apply the last character's advance for width calculation */
+#define EVAS_TEXTBLOCK_ITEM_SIZE(it) \
+ ((it->w > it->adv) ? it->w : it->adv)
+
+#define EVAS_TEXTBLOCK_TEXT_ITEM_SIZE(ti) \
+ ((ti->parent.w > ti->parent.adv) ? ti->parent.w : ti->parent.adv)
+/* END */
+
#ifdef CRI
#undef CRI
#endif
it->x = x;
x += it->adv + obs_adv;
+ /* TIZEN_ONLY(20161007): Apply the last character's advance for width calculation
if ((it->w > 0) && ((it->x + it->w) > c->ln->w)) c->ln->w = it->x + it->w;
+ */
+ if ((it->x + EVAS_TEXTBLOCK_ITEM_SIZE(it)) > c->ln->w)
+ c->ln->w = it->x + EVAS_TEXTBLOCK_ITEM_SIZE(it);
+ /* END */
}
/* clear obstacle info for this line */
last_it = it;
save_cx = c->x;
+ /* TIZEN_ONLY(20161007): Apply the last character's advance for width calculation
c->w -= ellip_ti->parent.w;
+ */
+ c->w -= EVAS_TEXTBLOCK_TEXT_ITEM_SIZE(ellip_ti);
+ /* END */
/* If there is no enough space for ellipsis item, remove all of items */
if (c->w <= 0)
/* We need to renew ellipsis item.
* Because, base format is changed to last_it.
* We can't reuse it. */
+ /* TIZEN_ONLY(20161007): Apply the last character's advance for width calculation
c->w += ellip_ti->parent.w;
ellip_ti = _layout_ellipsis_item_new(c, last_it);
c->w -= ellip_ti->parent.w;
+ */
+ c->w += EVAS_TEXTBLOCK_TEXT_ITEM_SIZE(ellip_ti);
+ ellip_ti = _layout_ellipsis_item_new(c, last_it);
+ c->w -= EVAS_TEXTBLOCK_TEXT_ITEM_SIZE(ellip_ti);
+ /* END */
c->x -= last_it->adv;
if (c->x < 0)
c->x = 0;
}
c->x = save_cx;
+ /* TIZEN_ONLY(20161007): Apply the last character's advance for width calculation
c->w += ellip_ti->parent.w;
+ */
+ c->w += EVAS_TEXTBLOCK_TEXT_ITEM_SIZE(ellip_ti);
+ /* END */
/* If we should add this item, do it */
if (last_it == it)
{
EINA_LIST_FOREACH(c->par->logical_items, i, it)
{
w += it->adv;
+ /* TIZEN_ONLY(20161007): Apply the last character's advance for width calculation
last_it = it;
+ */
+ if ((it->w > 0) || (it->adv > 0))
+ last_it = it;
+ /* END */
}
//reaching this point when it is the last item
+ /* TIZEN_ONLY(20161007): Apply the last character's advance for width calculation
if (last_it)
w += last_it->w - last_it->adv;
+ */
+ if (last_it && (last_it->w > last_it->adv))
+ w += last_it->w - last_it->adv;
+ /* END */
return w;
}
EINA_INLIST_FOREACH(c->ln->items, vis_it)
{
needed_w += vis_it->adv;
+ /* TIZEN_ONLY(20161007): Apply the last character's advance for width calculation
if (vis_it->w > 0)
last_it = vis_it;
+ */
+ if ((vis_it->w > 0) || (vis_it->adv > 0))
+ last_it = vis_it;
+ /* END */
}
+ /* TIZEN_ONLY(20161007): Apply the last character's advance for width calculation
if (last_it)
needed_w += last_it->w - last_it->adv;
+ */
+ if (last_it && (last_it->w > last_it->adv))
+ needed_w += last_it->w - last_it->adv;
+ /* END */
/* Restore */
c->ln->items = (Evas_Object_Textblock_Item *)
else
#endif
{
+ /* TIZEN_ONLY(20161007): Apply the last character's advance for width calculation
needed_w = c->x + it->w;
+ */
+ needed_w = c->x + it->adv;
+ if (it->w > it->adv)
+ needed_w += it->w - it->adv;
+ /* END */
}
/* END */
*w += it->adv;
/* Update visible last item in the logical order */
+ /* TIZEN_ONLY(20161007): Apply the last character's advance for width calculation
if (!is_bidi && (it->w > 0))
last_it = it;
+ */
+ if (!is_bidi && ((it->w > 0) || (it->adv > 0)))
+ last_it = it;
+ /* END */
}
/* rectify width of line using the last item */
+ /* TIZEN_ONLY(20161007): Apply the last character's advance for width calculation
if (last_it)
*w += last_it->w - last_it->adv;
+ */
+ if (last_it && (last_it->w > last_it->adv))
+ *w += last_it->w - last_it->adv;
+ /* END */
}
/* FIXME: doc */