summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCedric Bail <cedric.bail@samsung.com>2013-10-02 19:07:48 +0900
committerCedric Bail <cedric.bail@samsung.com>2013-10-02 20:57:29 +0900
commit4c572c827a2ff0a81c15cb95c52096759ee3d315 (patch)
treee71114bf807e96abb71356fd4264b429d8746a8c /src
parentfa6523929d9c8906bdadb950008fc05ce231861f (diff)
evas: we actually need to take those additional value into account.
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/canvas/evas_object_text.c30
1 files changed, 8 insertions, 22 deletions
diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c
index 7e9a081c36..cf31ed9fd9 100644
--- a/src/lib/evas/canvas/evas_object_text.c
+++ b/src/lib/evas/canvas/evas_object_text.c
@@ -325,20 +325,9 @@ _evas_object_text_char_at_coords(const Evas_Object *eo_obj,
325} 325}
326 326
327static Evas_Coord 327static Evas_Coord
328_evas_object_text_horiz_advance_get(const Evas_Object *eo_obj, 328_evas_object_text_horiz_advance_get(const Evas_Object_Text *o)
329 const Evas_Object_Text *o)
330{ 329{
331 Evas_Object_Text_Item *it; 330 return o->last_computed.advance;
332 Evas_Coord adv;
333 (void) eo_obj;
334
335 adv = 0;
336 EINA_INLIST_FOREACH(EINA_INLIST_GET(o->items), it)
337 {
338 adv += it->adv;
339 }
340
341 return adv;
342} 331}
343 332
344static Evas_Coord 333static Evas_Coord
@@ -1256,14 +1245,14 @@ evas_object_text_horiz_advance_get(const Evas_Object *eo_obj)
1256} 1245}
1257 1246
1258static void 1247static void
1259_text_horiz_advance_get(Eo *eo_obj, void *_pd, va_list *list) 1248_text_horiz_advance_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
1260{ 1249{
1261 Evas_Coord *horiz = va_arg(*list, Evas_Coord *); 1250 Evas_Coord *horiz = va_arg(*list, Evas_Coord *);
1262 *horiz = 0; 1251 *horiz = 0;
1263 const Evas_Object_Text *o = _pd; 1252 const Evas_Object_Text *o = _pd;
1264 if (!o->font) return; 1253 if (!o->font) return;
1265 if (!o->items) return; 1254 if (!o->items) return;
1266 *horiz = _evas_object_text_horiz_advance_get(eo_obj, o); 1255 *horiz = _evas_object_text_horiz_advance_get(o);
1267} 1256}
1268 1257
1269EAPI Evas_Coord 1258EAPI Evas_Coord
@@ -2475,9 +2464,10 @@ _evas_object_text_recalc(Evas_Object *eo_obj, Eina_Unicode *text)
2475 2464
2476 if ((o->font) && (o->items)) 2465 if ((o->font) && (o->items))
2477 { 2466 {
2478 int h; 2467 int w, h;
2479 int l = 0, r = 0, t = 0, b = 0; 2468 int l = 0, r = 0, t = 0, b = 0;
2480 2469
2470 w = _evas_object_text_horiz_advance_get(o);
2481 h = _evas_object_text_vert_advance_get(eo_obj, o); 2471 h = _evas_object_text_vert_advance_get(eo_obj, o);
2482 evas_text_style_pad_get(o->cur.style, &l, &r, &t, &b); 2472 evas_text_style_pad_get(o->cur.style, &l, &r, &t, &b);
2483 2473
@@ -2485,16 +2475,12 @@ _evas_object_text_recalc(Evas_Object *eo_obj, Eina_Unicode *text)
2485 { 2475 {
2486 int min; 2476 int min;
2487 2477
2488 min = o->last_computed.advance < obj->cur->geometry.w ? o->last_computed.advance : obj->cur->geometry.w; 2478 min = w + l + r < obj->cur->geometry.w ? w + l + r : obj->cur->geometry.w;
2489 eo_do_super(eo_obj, MY_CLASS, 2479 eo_do_super(eo_obj, MY_CLASS,
2490 evas_obj_size_set(min, h + t + b)); 2480 evas_obj_size_set(min, h + t + b));
2491 } 2481 }
2492 else 2482 else
2493 { 2483 {
2494 int w;
2495
2496 w = _evas_object_text_horiz_advance_get(eo_obj, o);
2497
2498 eo_do_super(eo_obj, MY_CLASS, 2484 eo_do_super(eo_obj, MY_CLASS,
2499 evas_obj_size_set(w + l + r, h + t + b)); 2485 evas_obj_size_set(w + l + r, h + t + b));
2500 } 2486 }