# HG changeset patch # User Thinker K.F. Li # Date 1233397730 -28800 # Node ID 13ce87b6dbf50795da5c6c6f9c0f25e746f1cf3e # Parent d5327265da1e9e0077c2ca0548153f64c99d1045 Fix bug of sh_text_t that do not update it-self after changes. - It is wrong to compute bounding box. - location of left-top corner is (text->d_x, text->d_y) not (text->x, text->y). diff -r d5327265da1e -r 13ce87b6dbf5 examples/dynamic/text.c --- a/examples/dynamic/text.c Sat Jan 31 17:35:27 2009 +0800 +++ b/examples/dynamic/text.c Sat Jan 31 18:28:50 2009 +0800 @@ -42,7 +42,12 @@ sh_text_set_text(text,"This is 1"); } rdman_shape_changed(MBAPP_RDMAN(myApp), text); +#if 0 + /* Removed! + * X_MB_handle_connection() will invoke it automatically. + */ rdman_redraw_changed(MBAPP_RDMAN(myApp)); +#endif } int main(int argc, char * const argv[]) { diff -r d5327265da1e -r 13ce87b6dbf5 src/redraw_man.c --- a/src/redraw_man.c Sat Jan 31 17:35:27 2009 +0800 +++ b/src/redraw_man.c Sat Jan 31 18:28:50 2009 +0800 @@ -1152,7 +1152,6 @@ if(dirty && coord->flags & COF_OWN_CANVAS) { update_canvas_2_parent(rdman, coord); clean_canvas_black(coord->canvas, rdman->w, rdman->h); - printf("update\n"); } return dirty; diff -r d5327265da1e -r 13ce87b6dbf5 src/shape_text.c --- a/src/shape_text.c Sat Jan 31 17:35:27 2009 +0800 +++ b/src/shape_text.c Sat Jan 31 18:28:50 2009 +0800 @@ -117,8 +117,8 @@ * We add 5 pixels in get right bbox. But, it is unreasonable. */ - poses[0][0] = x + extents.x - shw; - poses[0][1] = y + extents.y - shw; + poses[0][0] = text->d_x + extents.x - shw; + poses[0][1] = text->d_y + extents.y - shw; poses[1][0] = poses[0][0] + extents.width + shape->stroke_width; poses[1][1] = poses[0][1] + extents.height + shape->stroke_width; geo_from_positions(shape->geo, 2, poses);