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: margins... werdibubble =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/evas/src/lib/canvas/evas_object_textblock.c,v retrieving revision 1.71 retrieving revision 1.72 diff -u -3 -r1.71 -r1.72 --- evas_object_textblock.c 15 Aug 2005 07:39:03 -0000 1.71 +++ evas_object_textblock.c 15 Aug 2005 09:43:53 -0000 1.72 @@ -434,7 +434,7 @@ int talloc; talloc = ((tlen + 31) >> 5) << 5; - ts = realloc(s, talloc); + ts = realloc(s, talloc + 1); if (!ts) return s; s = ts; *alloc = talloc; @@ -465,7 +465,7 @@ int talloc; talloc = ((tlen + 31) >> 5) << 5; - ts = realloc(s, talloc); + ts = realloc(s, talloc + 1); if (!ts) return s; s = ts; *alloc = talloc; @@ -1363,6 +1363,36 @@ fmt->wrap_char = 0; } } + else if (!strcmp(cmd, "left_margin")) + { + if (!strcmp(param, "reset")) + fmt->margin.l = 0; + else + { + if (param[0] == '+') + fmt->margin.l += atoi(&(param[1])); + else if (param[0] == '-') + fmt->margin.l -= atoi(&(param[1])); + else + fmt->margin.l = atoi(param); + if (fmt->margin.l < 0) fmt->margin.l = 0; + } + } + else if (!strcmp(cmd, "right_margin")) + { + if (!strcmp(param, "reset")) + fmt->margin.r = 0; + else + { + if (param[0] == '+') + fmt->margin.r += atoi(&(param[1])); + else if (param[0] == '-') + fmt->margin.r -= atoi(&(param[1])); + else + fmt->margin.r = atoi(param); + if (fmt->margin.r < 0) fmt->margin.r = 0; + } + } if (new_font) { @@ -1391,7 +1421,7 @@ int qoute = 0; p = strchr(item, '='); - k = malloc(p - item); + k = malloc(p - item + 1); strncpy(k, item, p - item); k[p - item] = 0; *key = k; @@ -1548,6 +1578,8 @@ { c->ln = calloc(1, sizeof(Evas_Object_Textblock_Line)); c->align = fmt->halign; + c->marginl = fmt->margin.l; + c->marginr = fmt->margin.r; c->lines = evas_object_list_append(c->lines, c->ln); c->x = 0; c->maxascent = c->maxdescent = 0; @@ -1592,6 +1624,8 @@ if (key) free(key); if (val) free(val); c->align = fmt->halign; + c->marginl = fmt->margin.l; + c->marginr = fmt->margin.r; } static void @@ -2138,6 +2172,8 @@ else if ((n->type == NODE_TEXT) && (n->text)) _layout_text_append(c, fmt, n); } + if ((c->ln) && (c->ln->items) && (fmt)) + _layout_line_advance(c, fmt); while (c->format_stack) { fmt = c->format_stack->data; @@ -2255,6 +2291,7 @@ it->format->color.normal.g, it->format->color.normal.b, it->format->color.normal.a); +// printf("DRAW: %i,%i [%s]\n", ln->x + it->x, ln->y + ln->baseline, it->text); ENFN->font_draw(output, context, surface, it->format->font.font, obj->cur.cache.geometry.x + ln->x + it->x + x, obj->cur.cache.geometry.y + ln->y + ln->baseline + y, ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs