* edje: fix fit code when string is empty.

SVN revision: 50537
This commit is contained in:
Cedric BAIL 2010-07-27 10:06:02 +00:00
parent d928a9ded8
commit a6b33190b0
1 changed files with 3 additions and 2 deletions

View File

@ -384,7 +384,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
if (ep->text.cache.in_str) eina_stringshare_del(ep->text.cache.in_str);
ep->text.cache.in_str = eina_stringshare_add(text);
ep->text.cache.in_size = size;
if (chosen_desc->text.fit_x)
if (chosen_desc->text.fit_x && (ep->text.cache.in_str != NULL && eina_stringshare_strlen(ep->text.cache.in_str) > 0))
{
if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path);
else evas_object_text_font_source_set(ep->object, NULL);
@ -421,6 +421,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
{
psize = size;
size = (size * sw) / tw;
/* fprintf(stderr, "size = %i (%i, %i)\n", size, sw, tw); */
if ((psize - size) >= 0) size = psize + 1;
if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path);
else evas_object_text_font_source_set(ep->object, NULL);
@ -432,7 +433,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
}
}
}
if (chosen_desc->text.fit_y)
if (chosen_desc->text.fit_y && (ep->text.cache.in_str != NULL && eina_stringshare_strlen(ep->text.cache.in_str) > 0))
{
/* if we fit in the x axis, too, size already has a somewhat
* meaningful value, so don't overwrite it with the starting