gnome-games r7737 - trunk/gnomine



Author: thomashpa
Date: Fri Jun 27 03:16:50 2008
New Revision: 7737
URL: http://svn.gnome.org/viewvc/gnome-games?rev=7737&view=rev

Log:
Handle right click dragging. Bug #515497

Modified:
   trunk/gnomine/minefield.c

Modified: trunk/gnomine/minefield.c
==============================================================================
--- trunk/gnomine/minefield.c	(original)
+++ trunk/gnomine/minefield.c	Fri Jun 27 03:16:50 2008
@@ -993,15 +993,15 @@
   if (mfield->lose || mfield->win)
     return FALSE;
 
-  if (mfield->bdown[0] || mfield->bdown[1]) {
-    x = event->x / minesize;
-    y = event->y / minesize;
+  x = event->x / minesize;
+  y = event->y / minesize;
 
-    c = cell_idx (mfield, x, y);
-    if (c == -1)
-      return 0;
+  c = cell_idx (mfield, x, y);
+  if (c == -1)
+    return 0;
 
-    if (c != mfield->cdown) {
+  if (c != mfield->cdown) {
+    if (mfield->bdown[0] || mfield->bdown[1]) {
       mfield->mines[mfield->cdown].down = 0;
       gtk_mine_draw (mfield, mfield->cdownx, mfield->cdowny);
 
@@ -1016,6 +1016,16 @@
 
       if (mfield->action == CLEAR_ACTION && mfield->mines[c].shown)
         gtk_minefield_multi_press (mfield, x, y, c);
+    } else if (mfield->bdown[2]) {
+      /*  Update clicked field on right click drag. See bug #  */
+      mfield->mines[mfield->cdown].down = 0;
+      mfield->action = NO_ACTION;
+      gtk_mine_draw (mfield, mfield->cdownx, mfield->cdowny);
+
+      mfield->cdownx = x;
+      mfield->cdowny = y;
+      mfield->cdown = c;
+      mfield->mines[c].down = 1;
     }
   }
   return FALSE;



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