Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/evas

Dir     : e17/libs/evas/src/lib/canvas


Modified Files:
        evas_object_textblock.c 


Log Message:
When there is formatting but no text, retrieve the height of the font.

===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/evas/src/lib/canvas/evas_object_textblock.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -3 -r1.50 -r1.51
--- evas_object_textblock.c     11 Mar 2005 04:54:35 -0000      1.50
+++ evas_object_textblock.c     30 Mar 2005 02:51:58 -0000      1.51
@@ -967,6 +967,8 @@
    Evas_Object_Textblock *o;
    Layout layout;
    Layout_Command command;
+   Node *node = NULL;
+   Layout_Node *lnode = NULL;
    Evas_Object_List *l, *ll, *layout_nodes = NULL;
    Layout_Node *line_start = NULL;
    int text_pos = 0, fw = 0, fh = 0, last_mdescent = 0, line = 0, last_line = 
0;
@@ -983,8 +985,6 @@
    evas_object_textblock_command_init(&command);
    for (l = (Evas_Object_List *)o->nodes; l; l = l->next)
      {
-        Node *node;
-       
        node = (Node *)l;
        if (node->format)
          {
@@ -1052,7 +1052,6 @@
 //   printf("RE-LAYOUT %ix%i!\n", w, h);
    for (l = (Evas_Object_List *)o->nodes; l; l = l->next)
      {
-       Layout_Node *lnode;
        Node *node;
        
        /* FIXME: we cant do this - we need to be able to qury text
@@ -1575,6 +1574,24 @@
          }
      }
    /*breakout:*/
+   if (!layout_nodes)
+     {
+        void *font = NULL;
+       int ascent = 0, descent = 0;
+
+       lnode = calloc(1, sizeof(Layout_Node));
+       lnode->source_node = node;
+       lnode->line = line;
+       lnode->text_pos = text_pos;     
+       last_line = line;
+       evas_object_textblock_layout_copy(&layout, &(lnode->layout));
+       if (layout.font.name)
+         layout.font.font = evas_font_load(obj->layer->evas, layout.font.name, 
layout.font.source, layout.font.size);
+       if (layout.font.font) ascent = ENFN->font_max_ascent_get(ENDT, 
layout.font.font);
+       if (layout.font.font) descent = ENFN->font_max_descent_get(ENDT, 
layout.font.font);
+       fh = layout.line.y + ascent + descent;
+       layout_nodes = evas_object_list_append(layout_nodes, lnode);
+     }
    evas_object_textblock_layout_clear(obj, &layout);
    *line_count = last_line + 1;
    fw += pad_r;




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to