]> git.cworth.org Git - wordgame/blobdiff - rack-fancy.c
Fix randomizing of letter positions to never end up on top of each other
[wordgame] / rack-fancy.c
index 9173abb30143579a73febd69a7a86603a5674246..8fc516f41788f87d828264afda97b08e37041b3c 100644 (file)
@@ -21,6 +21,7 @@
 #include <sys/time.h>
 #include <time.h>
 #include <ctype.h>
+#include <math.h>
 
 #include "word-game.h"
 #include "demo-item.h"
@@ -106,12 +107,7 @@ on_button_press (GooCanvasItem  *item,
 
     for (i = 0; i < num_letters; i++) {
        get_letter_position (indices[i], &x, &y);
-       goo_canvas_item_animate (letter_items[i],
-                                x - GOO_DEMO_ITEM (letter_items[i])->x,
-                                y - GOO_DEMO_ITEM (letter_items[i])->y,
-                                1.0, 0,
-                                1000, 40,
-                                GOO_CANVAS_ANIMATE_FREEZE);
+       goo_demo_item_move_to (letter_items[i], x, y);
     }
 
     return TRUE;
@@ -137,7 +133,7 @@ create_canvas (GtkWidget *parent, char *word)
        get_letter_position (i, &x, &y);
        letter_items[i] = goo_demo_item_new (root,
                                             x, y,
-                                            LETTER_SIZE, LETTER_SIZE,
+                                            LETTER_SIZE,
                                             word[i],
                                             NULL);