# HG changeset patch # User Thinker K.F. Li # Date 1284697295 -28800 # Node ID 9f305d895e8ff0057b23f07b53a377a9059f14bd # Parent 419c7de41bfa66c5773b5d17833f7295656c72e2 Keep width and height of a canvas for mock of canvas diff -r 419c7de41bfa -r 9f305d895e8f src/redraw_man.c --- a/src/redraw_man.c Fri Sep 17 12:21:35 2010 +0800 +++ b/src/redraw_man.c Fri Sep 17 12:21:35 2010 +0800 @@ -522,6 +522,7 @@ */ typedef struct { co_aix parent_2_cache[6]; + int w, h; } mock_mbe_t; #endif @@ -536,7 +537,13 @@ return cr; #else - return (mbe_t *)malloc(sizeof(mock_mbe_t)); + mock_mbe_t *mbe; + + mbe = malloc(sizeof(mock_mbe_t)); + mbe->w = w; + mbe->h = h; + + return (mbe_t *)mbe; #endif } @@ -556,8 +563,11 @@ *w = mbe_image_surface_get_width(surface); *h = mbe_image_surface_get_height(surface); #else - *w = 0; - *h = 0; + mock_mbe_t *mbe; + + mbe = (mock_mbe_t *)canvas; + *w = mbe->w; + *h = mbe->h; #endif } @@ -1347,7 +1357,7 @@ area_init(coord_get_pcache_area(coord), 4, poses); - coord_set_flags(coord, COF_DIRTY_PCACHE_AREA); + coord_clear_flags(coord, COF_DIRTY_PCACHE_AREA); } /*! \brief Compute area of a coord. @@ -2922,6 +2932,7 @@ coord2->matrix[2] = 20; coord2->matrix[5] = 30; rdman_coord_changed(rdman, coord2); + rdman_redraw_changed(rdman); /* To test if transform matrix of cached coord working */ parent_2_cache = ((mock_mbe_t *)_coord_get_canvas(coord2))->parent_2_cache;