summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_object_textblock.c
diff options
context:
space:
mode:
authorDaniel Hirt <hirt.danny@gmail.com>2017-09-26 10:38:46 +0300
committerDaniel Hirt <hirt.danny@gmail.com>2017-09-26 10:52:38 +0300
commitbfa7d2a3b2d6dbd20d6232e950d538611fdb7a9e (patch)
tree17edaf468130d9c6716d513776ef18af75612868 /src/lib/evas/canvas/evas_object_textblock.c
parentd567faa7787afb3d478f1c857cb28ab4fa0e5fc3 (diff)
Evas textblock: fix ascent/descent calc
This is a follow-up to 4d4401f3a60024a0762393c3984065b73927eb86. The format line adjustment (e.g. linegap) should calculate the current item's ascent/descent, and then update c->ascent/c->descent. Otherwise we accumulate calculations like linegap values ref D5217
Diffstat (limited to 'src/lib/evas/canvas/evas_object_textblock.c')
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c
index d371ab00a9..60d2ff0545 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -3032,25 +3032,22 @@ _layout_item_ascent_descent_adjust(Evas_Object_Protected_Data *obj,
3032 } 3032 }
3033 } 3033 }
3034 3034
3035 if (fmt)
3036 {
3037 asc = ENFN->font_ascent_get(ENC, fmt->font.font);
3038 desc = ENFN->font_descent_get(ENC, fmt->font.font);
3039
3040 if (asc > *ascent) *ascent = asc;
3041 if (desc > *descent) *descent = desc;
3042 }
3043
3044 if (fi) 3035 if (fi)
3045 { 3036 {
3046 asc = evas_common_font_instance_ascent_get(fi); 3037 asc = evas_common_font_instance_ascent_get(fi);
3047 desc = evas_common_font_instance_descent_get(fi); 3038 desc = evas_common_font_instance_descent_get(fi);
3039 }
3048 3040
3049 if (asc > *ascent) *ascent = asc; 3041 else if (fmt)
3050 if (desc > *descent) *descent = desc; 3042 {
3043 asc = ENFN->font_ascent_get(ENC, fmt->font.font);
3044 desc = ENFN->font_descent_get(ENC, fmt->font.font);
3051 } 3045 }
3052 3046
3053 if (fmt) _layout_format_ascent_descent_adjust(obj, ascent, descent, fmt); 3047 if (fmt) _layout_format_ascent_descent_adjust(obj, &asc, &desc, fmt);
3048
3049 if (asc > *ascent) *ascent = asc;
3050 if (desc > *descent) *descent = desc;
3054} 3051}
3055 3052
3056/** 3053/**