From: Enlightenment S. <no-...@en...> - 2010-07-27 10:06:09
|
Log: * edje: fix fit code when string is empty. Author: cedric Date: 2010-07-27 03:06:02 -0700 (Tue, 27 Jul 2010) New Revision: 50537 Modified: trunk/edje/src/lib/edje_text.c Modified: trunk/edje/src/lib/edje_text.c =================================================================== --- trunk/edje/src/lib/edje_text.c 2010-07-27 09:56:52 UTC (rev 50536) +++ trunk/edje/src/lib/edje_text.c 2010-07-27 10:06:02 UTC (rev 50537) @@ -384,7 +384,7 @@ 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 @@ { 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 @@ } } } - 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 |