Evas text/textblock: Change item size calculation to use advance again.

We don't need to do any tricks anymore because size calculation is now
very fast, as fast as the tricks we did, so it's best to just do what
we really want to do.

SVN revision: 58757
This commit is contained in:
Tom Hacohen 2011-04-20 14:20:54 +00:00
parent 543c0cafc0
commit b59156c788
2 changed files with 9 additions and 9 deletions

View File

@ -486,8 +486,8 @@ _evas_object_text_item_new(Evas_Object *obj, Evas_Object_Text *o,
o->engine_data,
&it->text_props,
&it->w, &it->h);
it->adv = it->w + ENFN->font_right_inset_get(ENDT, o->engine_data,
&it->text_props);
it->adv = ENFN->font_h_advance_get(ENDT, o->engine_data,
&it->text_props);
}
o->items = (Evas_Object_Text_Item *)
eina_inlist_append(EINA_INLIST_GET(o->items), EINA_INLIST_GET(it));

View File

@ -2487,8 +2487,7 @@ _layout_item_merge_and_free(Ctxt *c,
evas_common_text_props_merge(&item1->text_props,
&item2->text_props);
item1->parent.w = item1->parent.adv + item2->parent.w;
item1->parent.adv += item2->parent.adv;
_text_item_update_sizes(c, item1);
item1->parent.merge = EINA_FALSE;
item1->parent.visually_deleted = EINA_FALSE;
@ -2608,7 +2607,7 @@ _layout_word_next(const Evas_Object_Textblock_Text_Item *ti, int p)
static void
_text_item_update_sizes(Ctxt *c, Evas_Object_Textblock_Text_Item *ti)
{
int tw, th, inset, right_inset;
int tw, th, inset, advw;
const Evas_Object_Textblock_Format *fmt = ti->parent.format;
int shad_sz = 0, shad_dst = 0, out_sz = 0;
int dx = 0, minx = 0, maxx = 0, shx1, shx2;
@ -2621,10 +2620,11 @@ _text_item_update_sizes(Ctxt *c, Evas_Object_Textblock_Text_Item *ti)
if (fmt->font.font)
inset = c->ENFN->font_inset_get(c->ENDT, fmt->font.font,
&ti->text_props);
right_inset = 0;
advw = 0;
if (fmt->font.font)
right_inset = c->ENFN->font_right_inset_get(c->ENDT, fmt->font.font,
&ti->text_props);
advw = c->ENFN->font_h_advance_get(c->ENDT, fmt->font.font,
&ti->text_props);
/* These adjustments are calculated and thus heavily linked to those in
* textblock_render!!! Don't change one without the other. */
@ -2693,7 +2693,7 @@ _text_item_update_sizes(Ctxt *c, Evas_Object_Textblock_Text_Item *ti)
ti->inset = inset;
ti->parent.w = tw + ti->x_adjustment;
ti->parent.h = th;
ti->parent.adv = tw + right_inset;
ti->parent.adv = advw;
ti->parent.x = 0;
}