Evas text/textblock: Change item size calculation to use advance again.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 20 Apr 2011 14:20:54 +0000 (14:20 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 20 Apr 2011 14:20:54 +0000 (14:20 +0000)
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.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@58757 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/canvas/evas_object_text.c
src/lib/canvas/evas_object_textblock.c

index 5f8b1b3..e7d6d12 100644 (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));
index 935c124..80e54e9 100644 (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;
 }