raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=229ee74f6c6637a369d46b771642cb91a3c34409

commit 229ee74f6c6637a369d46b771642cb91a3c34409
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Sat Feb 8 22:54:56 2014 +0900

    evas - textblock ... fix valign handling to actually work as documented
    
    valign handling was really broken. this fixes it to pretty much work
    again. ie 0.0 == top, 0.5 == centered, 1.0 == bottom align and -1.0
    == baseline. only baseline worked before.
---
 src/lib/evas/canvas/evas_object_textblock.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index f62370d..c717ac4 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -10743,7 +10743,15 @@ evas_object_textblock_render(Evas_Object *eo_obj 
EINA_UNUSED,
                   yoff = ln->baseline; \
                   if (itr->format->valign != -1.0) \
                     { \
-                       yoff += itr->format->valign * (ln->h - itr->h); \
+                       if (itr->type == EVAS_TEXTBLOCK_ITEM_TEXT) \
+                         { \
+                            Evas_Object_Textblock_Text_Item *titr = \
+                              (Evas_Object_Textblock_Text_Item *)itr; \
+                            yoff = \
+                              
evas_common_font_instance_max_ascent_get(titr->text_props.font_instance) +\
+                              (itr->format->valign * (ln->h - itr->h)); \
+                         } \
+                       else yoff = itr->format->valign * (ln->h - itr->h); \
                     } \
                   itr->yoff = yoff;             \
                   if (clip) \

-- 


Reply via email to