From: Daniel Hirt Date: Tue, 26 Sep 2017 07:38:46 +0000 (+0300) Subject: Evas textblock: fix ascent/descent calc X-Git-Tag: submit/sandbox/upgrade/efl120/20180319.053334~2504 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bfa7d2a3b2d6dbd20d6232e950d538611fdb7a9e;p=platform%2Fupstream%2Fefl.git 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 --- diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index d371ab0..60d2ff0 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, } } - if (fmt) - { - asc = ENFN->font_ascent_get(ENC, fmt->font.font); - desc = ENFN->font_descent_get(ENC, fmt->font.font); - - if (asc > *ascent) *ascent = asc; - if (desc > *descent) *descent = desc; - } - if (fi) { asc = evas_common_font_instance_ascent_get(fi); desc = evas_common_font_instance_descent_get(fi); + } - if (asc > *ascent) *ascent = asc; - if (desc > *descent) *descent = desc; + else if (fmt) + { + asc = ENFN->font_ascent_get(ENC, fmt->font.font); + desc = ENFN->font_descent_get(ENC, fmt->font.font); } - if (fmt) _layout_format_ascent_descent_adjust(obj, ascent, descent, fmt); + if (fmt) _layout_format_ascent_descent_adjust(obj, &asc, &desc, fmt); + + if (asc > *ascent) *ascent = asc; + if (desc > *descent) *descent = desc; } /**