changeset 834:9f305d895e8f

Keep width and height of a canvas for mock of canvas
author Thinker K.F. Li <thinker@codemud.net>
date Fri, 17 Sep 2010 12:21:35 +0800
parents 419c7de41bfa
children 51da337879bd
files src/redraw_man.c
diffstat 1 files changed, 15 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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;