From 3663f31067d667bafa32b731008c6174f51b86e3 Mon Sep 17 00:00:00 2001 From: tasn Date: Thu, 3 Nov 2011 12:37:07 +0000 Subject: [PATCH] Edje text: Remove identical if paths, one is enough. Thanks to David Seikel. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@64689 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/edje_text.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/lib/edje_text.c b/src/lib/edje_text.c index 6436f52..01faf99 100644 --- a/src/lib/edje_text.c +++ b/src/lib/edje_text.c @@ -448,7 +448,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep, evas_object_text_text_set(ep->object, text); part_get_geometry(ep, &tw, &th); /* Find the wanted font size */ - if ((tw > sw) && (size > 0) && (tw != 0)) + if ((tw != sw) && (size > 0) && (tw != 0)) { size = (size * sw) / tw; @@ -459,17 +459,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep, evas_object_text_font_set(ep->object, font, size); part_get_geometry(ep, &tw, &th); } - else if ((tw < sw) && (size > 0) && (tw != 0)) - { - size = (size * sw) / tw; - - if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path); - else evas_object_text_font_source_set(ep->object, NULL); - if (ep->part->scale) evas_object_scale_set(ep->object, TO_DOUBLE(sc)); - evas_object_text_font_set(ep->object, font, size); - part_get_geometry(ep, &tw, &th); - } /* FIXME: This should possibly be replaced by more proper handling, * but it's still way better than what was here before. */ if (tw > sw) size--; -- 2.7.4