summaryrefslogtreecommitdiff
path: root/legacy/edje/src/lib/edje_text.c
diff options
context:
space:
mode:
authortsauerbeck <tsauerbeck>2005-03-20 22:16:24 +0000
committertsauerbeck <tsauerbeck@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>2005-03-20 22:16:24 +0000
commit0a39ed2865b492ba3ad893ecfca1d45852573a79 (patch)
tree24d097c1d91c49e3a068450710ab431b37716e0e /legacy/edje/src/lib/edje_text.c
parentcdbe6efc98d02e9e7446c28489536e51c751f376 (diff)
fixed text fitting on both the x and the y axis
SVN revision: 13819
Diffstat (limited to 'legacy/edje/src/lib/edje_text.c')
-rw-r--r--legacy/edje/src/lib/edje_text.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/legacy/edje/src/lib/edje_text.c b/legacy/edje/src/lib/edje_text.c
index 9f428b1..064bd90 100644
--- a/legacy/edje/src/lib/edje_text.c
+++ b/legacy/edje/src/lib/edje_text.c
@@ -634,14 +634,23 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
634 } 634 }
635 if (chosen_desc->text.fit_y) 635 if (chosen_desc->text.fit_y)
636 { 636 {
637 size = sh; 637 /* if we fit in the x axis, too, size already has a somewhat
638 * meaningful value, so don't overwrite it with the starting
639 * value in that case
640 */
641 if (!chosen_desc->text.fit_x) size = sh;
642
638 if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path); 643 if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path);
639 else evas_object_text_font_source_set(ep->object, NULL); 644 else evas_object_text_font_source_set(ep->object, NULL);
640 645
641 evas_object_text_font_set(ep->object, font, size); 646 evas_object_text_font_set(ep->object, font, size);
642 evas_object_text_text_set(ep->object, text); 647 evas_object_text_text_set(ep->object, text);
643 evas_object_geometry_get(ep->object, NULL, NULL, &tw, &th); 648 evas_object_geometry_get(ep->object, NULL, NULL, &tw, &th);
644 if (th < sh) 649
650 /* only grow the font size if we didn't already reach the max size
651 * for the x axis
652 */
653 if (!chosen_desc->text.fit_x && th < sh)
645 { 654 {
646 int dif; 655 int dif;
647 656