[cairo-commit] cairo-demo/sproing ChangeLog, 1.8, 1.9 sproing.c, 1.7, 1.8

Carl Worth commit at pdx.freedesktop.org
Wed Apr 13 08:55:53 PDT 2005


Committed by: cworth

Update of /cvs/cairo/cairo-demo/sproing
In directory gabe:/tmp/cvs-serv19529

Modified Files:
	ChangeLog sproing.c 
Log Message:

        * sproing.c (WALL_X, WALL_Y): Double the size of the wall spacing
        in each dimension.
        (draw_wall): Draw a solid color in the background of the wall area.


Index: ChangeLog
===================================================================
RCS file: /cvs/cairo/cairo-demo/sproing/ChangeLog,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- ChangeLog	29 Mar 2005 00:39:03 -0000	1.8
+++ ChangeLog	13 Apr 2005 15:55:50 -0000	1.9
@@ -1,3 +1,9 @@
+2005-04-13  Carl Worth  <cworth at cworth.org>
+
+	* sproing.c (WALL_X, WALL_Y): Double the size of the wall spacing
+	in each dimension.
+	(draw_wall): Draw a solid color in the background of the wall area.
+
 2005-03-28  Kristian Høgsberg  <krh at redhat.com>
 
 	* sproing.c (model_step_object): Add simplistic collision

Index: sproing.c
===================================================================
RCS file: /cvs/cairo/cairo-demo/sproing/sproing.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- sproing.c	29 Mar 2005 00:39:03 -0000	1.7
+++ sproing.c	13 Apr 2005 15:55:50 -0000	1.8
@@ -23,8 +23,8 @@
 #define DEFAULT_SPRING_K 15.0
 #define DEFAULT_FRICTION  4.2
 
-#define WALL_X 400
-#define WALL_Y 300
+#define WALL_X 800
+#define WALL_Y 600
 
 struct _Spring {
   Object *a;
@@ -519,6 +519,14 @@
   
   cr = begin_paint (widget->window);
 
+  cairo_save (cr);
+  {
+    cairo_rectangle (cr, 0, 0, WALL_X, WALL_Y);
+    cairo_set_rgb_color (cr, 0.8, 0.7, 0.7);
+    cairo_fill (cr);
+  }
+  cairo_restore (cr);
+
   cairo_move_to (cr, 0, WALL_Y);
   cairo_line_to (cr, WALL_X, WALL_Y);
   cairo_line_to (cr, WALL_X, 0);
@@ -535,6 +543,8 @@
   Model *model = data;
   int i;
 
+  draw_wall (widget);
+
 #if 0
   draw_spline_spiral (widget, model);
 #else
@@ -553,8 +563,6 @@
   }
 #endif
 
-  draw_wall (widget);
-
   return TRUE;
 }
 
@@ -676,7 +684,7 @@
 
   label = gtk_label_new_with_mnemonic ("_Spring constant:");
   gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
-  spinner = gtk_spin_button_new_with_range  (0.05, 15.00, 0.05);
+  spinner = gtk_spin_button_new_with_range  (0.05, 30.00, 0.05);
   gtk_label_set_mnemonic_widget (GTK_LABEL (label), spinner);
   gtk_box_pack_start (GTK_BOX (hbox), spinner, FALSE, FALSE, 0);
   gtk_spin_button_set_value (GTK_SPIN_BUTTON (spinner), model->k);




More information about the cairo-commit mailing list