Enlightenment CVS committal Author : raster Project : e17 Module : libs/evas
Dir : e17/libs/evas/src/lib/canvas Modified Files: evas_object_textblock.c Log Message: and get ourselves another 10% speedup with textblock... :) (and in fact pave the way for overflow objects) =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/evas/src/lib/canvas/evas_object_textblock.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -3 -r1.17 -r1.18 --- evas_object_textblock.c 1 Feb 2005 07:58:02 -0000 1.17 +++ evas_object_textblock.c 1 Feb 2005 08:23:53 -0000 1.18 @@ -515,20 +515,23 @@ { Layout_Node *lnode; Node *node; - int newline; + /* FIXME: if we overflow then this would be punted to an overflow */ + /* object instead */ + if (layout.line.y >= h) return; node = (Node *)l; // printf("NODE: FMT:\"%s\" TXT:\"%s\"\n", node->format, node->text); - newline = 0; if (node->format) { /* first handle newline, tab etc. etc */ if (!strcmp(node->format, "\n")) { layout.line.x = 0; + if ((layout.line.y + lnode->layout.line.mascent + lnode->layout.line.mdescent) > h) + { + /* FIXME: this node would overflow to the next textblock */ + } layout.line.y += lnode->layout.line.mascent + lnode->layout.line.mdescent; - layout.line.mascent = 0; - layout.line.mdescent = 0; } else evas_object_textblock_layout_format_modify(&layout, node->format); @@ -548,6 +551,16 @@ evas_object_textblock_layout_copy(&layout, &(lnode->layout)); if (lnode->layout.font.name) font = evas_font_load(obj->layer->evas, lnode->layout.font.name, lnode->layout.font.source, lnode->layout.font.size); + /* if this is at the start of the line... */ + if (layout.line.x == 0) + { + if (font) inset = ENFN->font_inset_get(ENDT, font, text); + layout.line.inset = inset; + layout.line.x = -inset; + layout.line.mascent = 0; + layout.line.mdescent = 0; + line_start = lnode; + } lnode->layout.font.font = font; if (font) ascent = ENFN->font_max_ascent_get(ENDT, font); if (font) descent = ENFN->font_max_descent_get(ENDT, font); @@ -557,14 +570,6 @@ layout.line.descent = descent; if (layout.line.mascent < ascent) layout.line.mascent = ascent; if (layout.line.mdescent < descent) layout.line.mdescent = descent; - /* if this is at the start of the line... */ - if (layout.line.x == 0) - { - if (font) inset = ENFN->font_inset_get(ENDT, font, text); - layout.line.inset = inset; - layout.line.x = -inset; - line_start = lnode; - } if (font) chrpos = ENFN->font_char_at_coords_get(ENDT, font, text, w - layout.line.x, 0, &cx, &cy, &cw, &ch); @@ -656,9 +661,11 @@ } layout.line.inset = 0; layout.line.x = 0; + if ((layout.line.y + lnode->layout.line.mascent + lnode->layout.line.mdescent) > h) + { + /* FIXME: this node would overflow to the next textblock */ + } layout.line.y += lnode->layout.line.mascent + lnode->layout.line.mdescent; - layout.line.mascent = 0; - layout.line.mdescent = 0; text = text2; /* still more text to go */ goto new_node; ------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs