diff src/redraw_man.c @ 22:8fcf2d878ecd

shapes with stroke
author Thinker K.F. Li <thinker@branda.to>
date Sat, 02 Aug 2008 16:20:15 +0800
parents 74d3d5dc9aaa
children 56f592f56ff7
line wrap: on
line diff
--- a/src/redraw_man.c	Sat Aug 02 16:06:53 2008 +0800
+++ b/src/redraw_man.c	Sat Aug 02 16:20:15 2008 +0800
@@ -460,8 +460,8 @@
  * ============================================================
  */
 
-static void fill_shape(redraw_man_t *rdman, shape_t *shape) {
-    paint_t *fill;
+static void draw_shape(redraw_man_t *rdman, shape_t *shape) {
+    paint_t *fill, *stroke;
 
     fill = shape->fill;
     if(fill) {
@@ -477,6 +477,20 @@
 #endif /* UNITTEST */
 	}
     }
+    stroke = shape->stroke;
+    if(stroke) {
+	stroke->prepare(stroke, rdman->cr);
+	switch(shape->sh_type) {
+	case SHT_PATH:
+	    sh_path_stroke(shape, rdman->cr);
+	    break;
+#ifdef UNITTEST
+	default:
+	    /* sh_dummy_fill(shape, rdman->cr); */
+	    break;
+#endif /* UNITTEST */
+	}
+    }
 }
 
 #ifndef UNITTEST
@@ -520,7 +534,7 @@
 }
 #endif /* UNITTEST */
 
-static void fill_shapes_in_areas(redraw_man_t *rdman,
+static void draw_shapes_in_areas(redraw_man_t *rdman,
 				 int n_areas,
 				 area_t **areas) {
     geo_t *visit_geo;
@@ -533,7 +547,7 @@
 	    clean_shape(visit_geo->shape);
 	for(i = 0; i < n_areas; i++) {
 	    if(is_overlay(visit_geo->cur_area, areas[i])) {
-		fill_shape(rdman, visit_geo->shape);
+		draw_shape(rdman, visit_geo->shape);
 		break;
 	    }
 	}
@@ -603,7 +617,7 @@
     dirty_areas = rdman->dirty_areas;
     if(n_dirty_areas > 0) {
 	make_clip(rdman, n_dirty_areas, dirty_areas);
-	fill_shapes_in_areas(rdman, n_dirty_areas, dirty_areas);
+	draw_shapes_in_areas(rdman, n_dirty_areas, dirty_areas);
 	rdman->n_dirty_areas = 0;
 	reset_clip(rdman);
     }
@@ -623,7 +637,7 @@
 	geo = STAILQ_NEXT(geo_t, next, geo)) {
 	if(geo->flags & GEF_DIRTY)
 	    clean_shape(geo->shape);
-	fill_shape(rdman, geo->shape);
+	draw_shape(rdman, geo->shape);
     }
 
     return OK;