From: Kevin Worth Date: Wed, 14 Mar 2007 15:28:14 +0000 (-0400) Subject: Commit to undo changes from previous commit X-Git-Url: https://git.cworth.org/git?p=kub;a=commitdiff_plain;h=c9b1daea75c698a7722c5ba349f9f0cf6a5fcda4 Commit to undo changes from previous commit --- diff --git a/kub.c b/kub.c index bb29e6f..99c6f6b 100644 --- a/kub.c +++ b/kub.c @@ -446,8 +446,6 @@ static gboolean on_button_press_event (GtkWidget *widget, GdkEventButton *event, event->y >= tile_y && event->y <= (tile_y + TILE_HEIGHT) ) game->current_tile = i; - else - game->current_tile = -1; } return TRUE; @@ -464,20 +462,19 @@ static gboolean on_button_motion_event (GtkWidget *widget, GdkEventMotion *event game_t *game, cairo_t *cr) { tile_t *tile; - if (game->current_tile >= 0) - { - tile = &game->deck.tiles[game->current_tile]; - - /* First, invalidate the region where the tile currently is. */ - gtk_widget_queue_draw_area (widget, tile->x, tile->y, TILE_WIDTH, TILE_HEIGHT); - - /* Then, move the tile */ - tile->x = event->x; - tile->y = event->y; - - /* Finally, invalidate the region where the tile is now. */ - gtk_widget_queue_draw_area (widget, tile->x, tile->y, TILE_WIDTH, TILE_HEIGHT); - } + + tile = &game->deck.tiles[game->current_tile]; + + /* First, invalidate the region where the tile currently is. */ + gtk_widget_queue_draw_area (widget, tile->x, tile->y, TILE_WIDTH, TILE_HEIGHT); + + /* Then, move the tile */ + tile->x = event->x; + tile->y = event->y; + + /* Finally, invalidate the region where the tile is now. */ + gtk_widget_queue_draw_area (widget, tile->x, tile->y, TILE_WIDTH, TILE_HEIGHT); + return TRUE; }