gcompris r3514 - branches/gcomprixogoo/src/clickgame-activity



Author: bcoudoin
Date: Sat Aug 30 23:01:59 2008
New Revision: 3514
URL: http://svn.gnome.org/viewvc/gcompris?rev=3514&view=rev

Log:
fixed image zoom (second level was too small)


Modified:
   branches/gcomprixogoo/src/clickgame-activity/clickgame.c

Modified: branches/gcomprixogoo/src/clickgame-activity/clickgame.c
==============================================================================
--- branches/gcomprixogoo/src/clickgame-activity/clickgame.c	(original)
+++ branches/gcomprixogoo/src/clickgame-activity/clickgame.c	Sat Aug 30 23:01:59 2008
@@ -365,7 +365,7 @@
   gcomprisBoard->number_of_sublevel=10;
   gc_score_start(SCORESTYLE_NOTE,
 		 BOARDWIDTH - 195,
-		 BOARDHEIGHT - 30,
+		 BOARDHEIGHT - 25,
 		 gcomprisBoard->number_of_sublevel);
   gc_bar_set(GC_BAR_LEVEL);
 
@@ -459,7 +459,10 @@
   /* Try the next level */
   moveSpeed=100+(40/(gcomprisBoard->level));
   fallSpeed=5000-gcomprisBoard->level*200;
-  imageZoom = 0.75 + 0.25 * ((gcomprisBoard->maxlevel - gcomprisBoard->level + 1) / gcomprisBoard->maxlevel);
+  imageZoom =
+    0.75 + 0.25
+    * ((double)(gcomprisBoard->maxlevel - gcomprisBoard->level + 1)
+       / gcomprisBoard->maxlevel);
   gcomprisBoard->sublevel=0;
   gc_score_set(gcomprisBoard->sublevel);
 
@@ -716,7 +719,7 @@
 
   length = g_slist_length(ilist);
 
-  y = (g_random_int()%(BOARDHEIGHT-
+  y = (g_random_int()%(BOARDHEIGHT - BARHEIGHT -
 		       (guint)(gdk_pixbuf_get_height(pixmap)*
 			       imageZoom)));
 
@@ -731,16 +734,15 @@
 				  pixmap,
 				  x,
 				  y,
-				  "width", (double) gdk_pixbuf_get_width(pixmap)*imageZoom,
-				  "height", (double) gdk_pixbuf_get_height(pixmap)*imageZoom,
 				  NULL);
+      goo_canvas_item_scale(fwd, imageZoom, imageZoom);
+
       rev = goo_canvas_image_new (rootitem,
 				  pixmap2,
 				  x,
 				  y,
-				  "width", (double) gdk_pixbuf_get_width(pixmap2)*imageZoom,
-				  "height", (double) gdk_pixbuf_get_height(pixmap2)*imageZoom,
 				  NULL);
+      goo_canvas_item_scale(rev, imageZoom, imageZoom);
       gdk_pixbuf_unref(pixmap);
       gdk_pixbuf_unref(pixmap2);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]