gnome-games r7203 - trunk/aisleriot



Author: chpe
Date: Sun Jan 13 22:08:42 2008
New Revision: 7203
URL: http://svn.gnome.org/viewvc/gnome-games?rev=7203&view=rev

Log:
Update the focus and selection rects when (re)calculating the
geometry.


Modified:
   trunk/aisleriot/board.c

Modified: trunk/aisleriot/board.c
==============================================================================
--- trunk/aisleriot/board.c	(original)
+++ trunk/aisleriot/board.c	Sun Jan 13 22:08:42 2008
@@ -565,7 +565,8 @@
 {
   AisleriotBoardPrivate *priv = board->priv;
 
-  g_return_if_fail (priv->focus_slot != NULL);
+  if (!priv->focus_slot)
+    return;
 
   get_rect_by_slot_and_card (board,
                              priv->focus_slot,
@@ -629,7 +630,8 @@
   AisleriotBoardPrivate *priv = board->priv;
   int n_cards;
 
-  g_return_if_fail (priv->selection_slot != NULL);
+  if (!priv->selection_slot)
+    return;
 
   n_cards = priv->selection_slot->cards->len - priv->selection_start_card_id;
 
@@ -960,6 +962,10 @@
     slot_update_geometry (board, slot);
     slot_update_card_images (board, slot);
   }
+
+  /* Update the focus and selection rects */
+  get_focus_rect (board, &priv->focus_rect);
+  get_selection_rect (board, &priv->selection_rect);
 }
 
 static void
@@ -2486,8 +2492,6 @@
                         "selection-color", &colour,
                         NULL);
 
-  /* FIXMEchpe: recalculate the focus_rect!!! */
-
   if (colour != NULL) {
     priv->selection_colour = *colour;
     gdk_color_free (colour);



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