Enlightenment CVS committal Author : dj2 Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_text.c Log Message: - we need to update the textblock size whenever we re-display the text as it may have changed. Not just on configure. =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_text.c,v retrieving revision 1.184 retrieving revision 1.185 diff -u -3 -r1.184 -r1.185 --- ewl_text.c 12 Nov 2007 22:42:22 -0000 1.184 +++ ewl_text.c 13 Nov 2007 05:55:48 -0000 1.185 @@ -39,6 +39,7 @@ unsigned int *byte_len); static int ewl_text_char_utf8_is(const char *c); +static void ewl_text_size(Ewl_Text *t); static void ewl_text_display(Ewl_Text *t); static void ewl_text_cb_format(Ewl_Text_Fmt_Node *node, Ewl_Text *t, unsigned int byte_idx); @@ -2868,6 +2869,26 @@ } static void +ewl_text_size(Ewl_Text *t) +{ + int xx, yy, ww, hh; + + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR(t); + DCHECK_TYPE(t, EWL_TEXT_TYPE); + + xx = CURRENT_X(t); + yy = CURRENT_Y(t); + hh = CURRENT_H(t); + ww = CURRENT_W(t); + + evas_object_move(t->textblock, xx + t->offset.x, yy + t->offset.y); + evas_object_resize(t->textblock, ww - t->offset.x, hh - t->offset.y); + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +static void ewl_text_display(Ewl_Text *t) { Evas_Coord w = 0, h = 0; @@ -2877,6 +2898,8 @@ DCHECK_PARAM_PTR(t); DCHECK_TYPE(t, EWL_TEXT_TYPE); + ewl_text_size(t); + evas_object_textblock_clear(t->textblock); cursor = (Evas_Textblock_Cursor *) @@ -2898,7 +2921,6 @@ ewl_text_cursor_position_set(t, cur_pos); t->formatting.tx = cur_tx; } - evas_object_textblock_size_formatted_get(t->textblock, &w, &h); /* Fallback, just in case we hit a corner case */ @@ -3116,7 +3138,6 @@ void *data __UNUSED__) { Ewl_Text *t; - int xx, yy, ww, hh; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR(w); @@ -3126,18 +3147,9 @@ if (!REVEALED(w)) DRETURN(DLEVEL_STABLE); t = EWL_TEXT(w); - xx = CURRENT_X(w); - yy = CURRENT_Y(w); - hh = CURRENT_H(w); - ww = CURRENT_W(w); - if (t->textblock) { - evas_object_move(t->textblock, xx + t->offset.x, - yy + t->offset.y); - evas_object_resize(t->textblock, ww - t->offset.x, - hh - t->offset.y); - + ewl_text_size(t); if (t->dirty) ewl_text_display(t); ewl_text_triggers_place(t); ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs