summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2013-06-07 18:12:41 +0100
committerTom Hacohen <tom@stosb.com>2013-06-07 18:12:41 +0100
commitcfa6614c95956fdc48bf49493d817bdb034207fc (patch)
tree3d5c275dc0ccd4cfc8e0519316ee50bef82c8f09
parent498b48a8af51f2af2dba27e1e69b556fbb709de5 (diff)
Evas font: Fix initialization of ascent/descent for empty objects.
-rw-r--r--src/lib/canvas/evas_object_text.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lib/canvas/evas_object_text.c b/src/lib/canvas/evas_object_text.c
index 4c22a9d2..705741ea 100644
--- a/src/lib/canvas/evas_object_text.c
+++ b/src/lib/canvas/evas_object_text.c
@@ -1909,6 +1909,7 @@ _evas_object_text_recalc(Evas_Object *obj)
1909 if (text) free(text); 1909 if (text) free(text);
1910 1910
1911 /* Calc ascent/descent. */ 1911 /* Calc ascent/descent. */
1912 if (o->items)
1912 { 1913 {
1913 Evas_Object_Text_Item *item; 1914 Evas_Object_Text_Item *item;
1914 1915
@@ -1928,11 +1929,16 @@ _evas_object_text_recalc(Evas_Object *obj)
1928 o->ascent = asc; 1929 o->ascent = asc;
1929 if (desc > o->descent) 1930 if (desc > o->descent)
1930 o->descent = desc; 1931 o->descent = desc;
1931
1932 o->max_ascent = o->ascent;
1933 o->max_descent = o->descent;
1934 } 1932 }
1935 } 1933 }
1934 else if (o->font)
1935 {
1936 o->ascent = ENFN->font_ascent_get(ENDT, o->font);
1937 o->descent = ENFN->font_descent_get(ENDT, o->font);
1938 }
1939
1940 o->max_ascent = o->ascent;
1941 o->max_descent = o->descent;
1936 1942
1937 if ((o->font) && (o->items)) 1943 if ((o->font) && (o->items))
1938 { 1944 {