diff src/geo.c @ 15:c2ce186a5c37

X_main uses rdman_redraw_all()
author Thinker K.F. Li <thinker@branda.to>
date Fri, 01 Aug 2008 01:40:07 +0800
parents ed55009d96d3
children 41f0907b27ac
line wrap: on
line diff
--- a/src/geo.c	Thu Jul 31 17:43:20 2008 +0800
+++ b/src/geo.c	Fri Aug 01 01:40:07 2008 +0800
@@ -31,12 +31,12 @@
     return _is_overlay(r1, r2);
 }
 
-void geo_init(geo_t *g, int n_pos, co_aix pos[][2]) {
+void area_init(area_t *area, int n_pos, co_aix pos[][2]) {
     co_aix min_x, max_x;
     co_aix min_y, max_y;
     co_aix x, y;
     int i;
-
+    
     min_x = max_x = pos[0][0];
     min_y = max_y = pos[0][1];
     for(i = 1; i < n_pos; i++) {
@@ -52,13 +52,16 @@
 	    max_y = y;
     }
 
+    area->x = min_x;
+    area->w = max_x - min_x;
+    area->y = min_y;
+    area->h = max_y - min_y;
+}
+
+void geo_init(geo_t *g, int n_pos, co_aix pos[][2]) {
     g->cur_area = g->areas;
     g->last_area = g->areas + 1;
-
-    g->cur_area->x = min_x;
-    g->cur_area->w = max_x - min_x;
-    g->cur_area->y = min_y;
-    g->cur_area->h = max_y - min_y;
+    area_init(g->cur_area, n_pos, pos);
 }
 
 void geo_mark_overlay(geo_t *g, int n_others, geo_t **others,