raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=5da69d7ac9b1ca5084a605dd5373ada9f17328ea

commit 5da69d7ac9b1ca5084a605dd5373ada9f17328ea
Author: Youngbok Shin <[email protected]>
Date:   Tue Apr 4 18:36:41 2017 +0900

    evas textblock: fix top/bottom valign tag reversed issue
    
    Summary:
    valign tag is for handling vertical align according to line's height and
    text's height. But, it worked in a line which has only one font and
    one font size, too. And the result was abnormal depending its font.
    The line's height is [ascent + descent]. But, Textblock uses max ascent and
    items's height(could be used max ascent + max descent according to its 
position)
    when Textblock calculates item's yoff.
    So, If Textblock calculate yoff based on line's height,
    it should use only ascent and descent instead of max ascent and max descent.
    @fix
    
    Test Plan: Will attached in comment section.
    
    Reviewers: raster, herdsman, jpeg, woohyun
    
    Reviewed By: raster
    
    Subscribers: cedric
    
    Differential Revision: https://phab.enlightenment.org/D4760
---
 src/lib/evas/canvas/evas_object_textblock.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index 306b66a..db58b62 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -13206,10 +13206,14 @@ evas_object_textblock_render(Evas_Object *eo_obj 
EINA_UNUSED,
                             Evas_Object_Textblock_Text_Item *titr = \
                               (Evas_Object_Textblock_Text_Item *)itr; \
                             int ascent = 0; \
+                            int descent = 0; \
                             if (titr->text_props.font_instance) \
-                              ascent = 
evas_common_font_instance_max_ascent_get(titr->text_props.font_instance); \
+                              { \
+                                 ascent = 
evas_common_font_instance_ascent_get(titr->text_props.font_instance); \
+                                 descent = 
evas_common_font_instance_descent_get(titr->text_props.font_instance); \
+                              } \
                             yoff = ascent + \
-                              (itr->format->valign * (ln->h - itr->h)); \
+                              (itr->format->valign * (ln->h - (ascent + 
descent))); \
                          } \
                        else yoff = itr->format->valign * (ln->h - itr->h); \
                     } \

-- 


Reply via email to